Graphics Reference
In-Depth Information
get
{
// get paused
return paused;
}
set
{
// set paused
paused = value;
if (paused)
{
// pause time
Time.timeScale= 0f;
} else {
// unpause Unity
Time.timeScale = 1f;
}
}
}
}
2.2.1.1 Script Breakdown
Many of the key functions in BaseGameController.cs are virtual, included to serve as an
established protocol for dealing with different types of game activity. That is, they contain
no code in this particular file, but the intention is that you override them in your own
derived versions of a game controller later on.
The BaseGameController class derives from MonoBehavior so that it can tap
into automatically called system functions such as Awake(), Start(), Update(), and
FixedUpdate():
public class BaseGameController : MonoBehavior
{
The functions are here as placeholders. The intention is that game controller scripts
for use in actual game projects will derive from this class and populate these interface
functions with functionality:
bool paused;
public GameObject explosionPrefab;
public virtual void PlayerLostLife ()
{
// deal with player life lost (update U.I. etc.)
}
public virtual void SpawnPlayer ()
{
// the player needs to be spawned
}
public virtual void Respawn ()
{
Search WWH ::




Custom Search