Exemple #1
0
 void Start()
 {
     gameOverParams = DebugUtil.AssertNotNull(GetComponentInChildren <GameOverParams>());
     timer          = DebugUtil.AssertNotNull(GetComponentInChildren <Timer>());
     // pause starts out inactive!
     pause = transform.parent.GetComponentsInChildren <Pause>(true)[0];
 }
Exemple #2
0
 private void GameOver()
 {
     DebugUtil.AssertNotNull(gameOverParams.cause);
     gameOverParams.elapsedSeconds   = timer.elapsedSeconds;
     gameOverParams.enemiesKilled    = enemyKillCount;
     gameOverParams.transform.parent = null;
     DontDestroyOnLoad(gameOverParams);
     Application.LoadLevel("GameOver");
 }
Exemple #3
0
 void OnEnable()
 {
     // onEnable runs before start :(
     if (unpause == null)
     {
         unpause = DebugUtil.AssertNotNull(transform.parent.GetComponentInChildren <Unpause>());
     }
     unpause.gameObject.SetActive(false);
     Time.timeScale = 0;
 }
Exemple #4
0
 void Start()
 {
     gameUI = GameObject.Find("/GameUI");
     anim   = DebugUtil.AssertNotNull(GetComponent <Animator>());
 }