Array Flashcards
1
Q
public GameObject[] animalPrefabs = new Game object[5];
A
int animalIndex = Random.Range(0, animalPrefabs.Length);
Instantiate (animalPrefabs[animalIndex], new Vector3(0,0,20), animalPrefabs[animalIndex].transform.rotation);
2
Q
public List < GameObject > targets;
A
Same as Array but slight diferent