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