public void Update() { if (Input.GetKeyDown(keyCode)) { if (Data.Name != "") { if (ObjEmptyIcon.GetComponent <Image>().fillAmount == 0.0f) { if (Data.EventName != "") { Camera.main.GetComponent <SkillScript>().StartCoroutine(Data.EventName, Player); } else { Debug.LogAssertion(Data.Name + "의 코루틴이 비어있습니다."); } ObjEmptyIcon.GetComponent <Image>().fillAmount = 1; StartCoroutine(CoolTime(0.01f)); Debug.Log(Data.Name + "이 시전되었습니다."); } else { Debug.Log(Data.Name + "의 쿨타임이 가동 중입니다."); } } else { Debug.LogAssertion(keyCode.ToString() + "에 할당된 것이 없습니다."); } } }
public IEnumerator CoolTime(float Delay) { NowTime += Delay; ObjEmptyIcon.GetComponent <Image>().fillAmount -= Delay / Data.CoolTime; yield return(new WaitForSeconds(Delay)); if (ObjEmptyIcon.GetComponent <Image>().fillAmount > 0.0f) { StartCoroutine(CoolTime(Delay)); } }