public IEnumerator ShowCountdownTime(int count, bool extraSound = false, float speed = 1.0f) { this.Countdown.gameObject.SetActive(true); var easing = new Shand.Easing(); while (count > 0) { this.Countdown.text = count.ToString(); easing.Start(Shand.EasingPattern.BounceOut, 0.5f * speed, 5.0f, 1.0f); while (!easing.Ended) { var s = easing.UpdateValue(Time.deltaTime) * 1.0f; this.Countdown.transform.localScale = new Vector3(s, s, 1.0f); yield return(null); } SeManager.Instance.Play(Sound.SeKind.Countdown.ToString(), 0.0f, false, 1.0f); yield return(new WaitForSeconds(0.5f * speed)); --count; } this.Countdown.gameObject.SetActive(false); Destroy(GameObject.Find("PauseWindow(Clone)")); if (onClose != null) { onClose(); } }
private void Update() { OnUpdate(); this.waiter.Update(); if (this.timer != null) { timer.UpdateValue(Time.deltaTime); } }