IEnumerator MissionCoolDown(MissionToDo missionToDo, float time) { if (_missionExec.ContainsKey(missionToDo)) { bool res = _missionExec[missionToDo]; if (res) { yield break; } else { _missionExec[missionToDo] = true; } } else { _missionExec.Add(missionToDo, true); } missionToDo(); yield return(new WaitForSeconds(time)); if (active == false) { yield break; } _missionExec[missionToDo] = false; }
public void CoolDownForMission(MissionToDo missionToDo, float cdTime) { StartCoroutine(MissionEnd(missionToDo, 0)); }
public void MissionStart(MissionToDo missionToDo, float delayedTime) { StartCoroutine(MissionEnd(missionToDo, delayedTime)); }