public IEnumerator DelaySkill() { #if TEST Debug.Log("start delay skill"); #endif double timedelaygame = timeDelay; canvasTxtTimeDelay.alpha = 1; btnSkill.interactable = false; imageDelay.fillAmount = 1; canvasImageDelay.alpha = 1; timedelaygame = Constant.ConvertMillisecondsToSeconds(timedelaygame); float timedelaysecond = (float)Constant.ConvertMillisecondsToSeconds(timeDelay); txtTimeDelay.text = string.Format("{0:00}", (long)timedelaygame); while (timedelaygame > 0) { yield return(null); timedelaygame -= Time.unscaledDeltaTime; txtTimeDelay.text = string.Format("{0:00}", (long)timedelaygame); imageDelay.fillAmount -= Time.unscaledDeltaTime / timedelaysecond; } canvasTxtTimeDelay.alpha = 0; btnSkill.interactable = true; imageDelay.fillAmount = 0; canvasImageDelay.alpha = 0; }