(Mache nach 2-4h Schlaf weiter. Noch nicht ganz fertig, aufgrund aufgrund mangelnder Zeit durch Arbeit, damaligen privaten Problemen und damals zu viel vorgenommen).
20 lines
418 B
C#
20 lines
418 B
C#
using UnityEngine;
|
|
|
|
public class GroundSpawner : MonoBehaviour
|
|
{
|
|
public GameObject groundPrefab;
|
|
public Vector3 nextSpawnPos;
|
|
|
|
void Start()
|
|
{
|
|
SpawnGround();
|
|
}
|
|
|
|
// instantiating ground
|
|
public void SpawnGround()
|
|
{
|
|
GameObject temp = Instantiate(groundPrefab, nextSpawnPos, Quaternion.identity);
|
|
nextSpawnPos = temp.transform.GetChild(1).transform.position;
|
|
}
|
|
}
|