Graphics Reference
In-Depth Information
4. Wave spawning. Attack waves are made from prefabs containing groups of ene-
mies. A wave spawner script named Wave_Spawner.cs instantiates the prefabs in a
random order and keeps track of how many enemies there are in the level so that it
knows when to spawn the next wave. Another small script called WaveProperties.
cs is attached to the enemy wave prefabs to tell the spawner how many enemies it
contains.
5. Projectiles. The projectiles are made up of the following:
a. Automatic Destroy Object script AutomaticDestroyObject.cs
b. ProjectileController.cs
c. Rigidbody component.
d. A sphere collider component.
6. User Interface. The user interface for in-game will derive from the BaseUI
DataManager script from Chapter 10, Section 10.2, which adds data management.
The main menu uses the main menu system outlined in Chapter 10.
7. Top Down Camera. One of the camera scripts from Chapter 4.
8. Sound Controller. The sound controller script from Chapter 8.
9. Music Controller. The music controller script from Chapter 8.
There are other pieces to the puzzle, such as an empty gameObject to act as a starting
position for the player named SpawnPosition (its transform position will be used as the
location to spawn the player at). As the scripts are broken down later in this chapter, the
other components should become apparent.
Note that those components already described in detail elsewhere in this topic will
not be covered in this section (the full list of ingredients, from early in this section, states
which scripts are from elsewhere).
11. 5 Game Controller
The Game Controller is a central communications hub for the game. It derives from
BaseGameController, overriding some of the base functions as well as adding some of its
own.
The full GameController_LBS.cs script looks like this:
using UnityEngine;
using System.Collections;
public class GameController_LBS : BaseGameController
{
public string mainMenuSceneName = "menu_LBS";
public GameObject[] playerPrefabList;
Search WWH ::




Custom Search