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);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

public List < GameObject > targets;

A

Same as Array but slight diferent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly