Game Development Reference
In-Depth Information
moving the
GameObject
in the list
flagPrefabs
at that slot, and adding it
to the
flagInstances
list as shown in the following code:
public List<GameObject> flagInstances;
5.
spawnPoints
is a list that holds the 10 potential spawn locations for flags in
this level as shown in the following code:
public List<GameObject> spawnPoints;
6.
spawnPointsBackup
is a copy of the previous list. This occurs once when
the game is run. The backup will be used to restore the
spawnPoints
list if
the mission is restarted as shown in the following code:
public List<GameObject>
spawnPointsBackup;
7.
activeSpawnPoints
is the list of five unique, selected
SpawnPoints
.
This list is populated from the
spawnpoints
list by choosing an index at ran-
dom, removing the
GameObject
in the
SpawnPoints
list, slow, and adding
it to the
activeSpawnPoints
list as shown in the following code:
public List<GameObject>
activeSpawnPoints;
8. Once the lists of selected
spawnpoints
and
flagprefabs
are filled, the
script initializes two missions.
9. The first one to be acquired is set to visible and active as shown in the fol-
lowing code:
Mission m = missionManager.missions[0];
m.activated = true;
m.visible = true;
m.status =
mission.missionStatus.MS_Acquired;
10. It is also given a
displayName
and
description
as shown in the following
code: