SpawnManager Flashcards
1
Q
public GameObject obstaclePrefabs;
private Vector3 spawnPos = new Vector3 (25,0,0);
A
void Start() { Instantiate(obstaclePrefabs, spawnPos, obstaclePrefabs.transform.rotation); }
2
Q
private float startDelay = 2;
private float repeateRate = 1;
A
void Start(){ InvokeRepeating ("SpawnObstacle",startDelay, repeateRate); } void SpawnObstacle(){ Instantiate(obstaclePrefabs, spawnPos, obstaclePrefabs.transform.rotation); }
3
Q
public GameObject enemyPrefab;
A
Instantiate(enemyPrefab, randomPos, enemyPrefab.gameObject.transform.rotation);