void Start() { //Regsiter to action CoutdownManager.UpdateStartTimerText += UpdateStartText; CoutdownManager.ShowTimerUI += ShowTimerUI; CoutdownManager.UpdateTimerText += UpdateTimer; CoutdownManager.PlayerLoose += PlayerLooseUI; CoutdownManager.GetCoutdown += GetTotalTime; GameManager.ShowResultUI += ShowResultUI; GameManager.ShowExplanation1 += ShowExplanation1; GameManager.ShowExplanation2 += ShowExplanation2; GameManager.ShowExplanation3 += ShowExplanation3; GameManager.RestartGame += Restart; Grabber.PlayerWin += PlayerWin; GameManager.Pause += ShowPause; CotcManager.ShowLog += ShowCutc; //Show UI ShowStartUI(true); //Get cotcmanager cotcM = GameObject.Find("CotcManager").GetComponent <CotcManager>(); if (cotcM != null && cotcM.GetIsLog()) { Debug.Log("UIManager - Call cotcM play"); cotcM.Play(); } }
//------------------------------------------------------- //Initialization void Awake() { // if the singleton hasn't been initialized yet if (Instance != null && Instance != this) { Destroy(this.gameObject); } else { Instance = this; DontDestroyOnLoad(this.gameObject); } }