/// <summary> /// Starts the timer. /// </summary> /// <param name='timeout'> /// Timeout duration in seconds. /// </param> public override void StartTimer(float timeout) { if (timer != null) { if (unityUITimer == null) { Tools.SetGameObjectActive(timer, true); unityUITimer = timer.GetComponent <UnityUITimer>(); if (unityUITimer == null) { unityUITimer = timer.gameObject.AddComponent <UnityUITimer>(); } Tools.SetGameObjectActive(timer, false); } if (unityUITimer != null) { Tools.SetGameObjectActive(timer, true); unityUITimer.StartCountdown(timeout, OnTimeout); } else { if (DialogueDebug.LogWarnings) { Debug.LogWarning(string.Format("{0}: No UnityUITimer component found on timer", DialogueDebug.Prefix)); } } } }
/// <summary> /// Starts the timer. /// </summary> /// <param name='timeout'> /// Timeout duration in seconds. /// </param> public override void StartTimer(float timeout) { if (timer != null) { if (unityUITimer == null) { Tools.SetGameObjectActive(timer, true); unityUITimer = timer.GetComponent<UnityUITimer>(); if (unityUITimer == null) unityUITimer = timer.gameObject.AddComponent<UnityUITimer>(); Tools.SetGameObjectActive(timer, false); } if (unityUITimer != null) { Tools.SetGameObjectActive(timer, true); unityUITimer.StartCountdown(timeout, OnTimeout); } else { if (DialogueDebug.LogWarnings) Debug.LogWarning(string.Format("{0}: No UnityUITimer component found on timer", DialogueDebug.Prefix)); } } }