void Start() { gameOverParams = DebugUtil.AssertNotNull(GetComponentInChildren <GameOverParams>()); timer = DebugUtil.AssertNotNull(GetComponentInChildren <Timer>()); // pause starts out inactive! pause = transform.parent.GetComponentsInChildren <Pause>(true)[0]; }
// Use this for initialization void Start() { var obj = GameObject.Find("/GameOverParams"); if (obj == null) { obj = GameObject.Find("/DefaultGameOverParams"); } DebugUtil.Assert(obj != null); args = obj.GetComponent <GameOverParams>(); DebugUtil.Assert(args != null); Destroy(obj); causeText = causeTexts[args.cause]; AudioSource.PlayClipAtPoint(playerDies, transform.position); }