Esempio n. 1
0
    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;
    }
Esempio n. 2
0
 public void CoolDownForMission(MissionToDo missionToDo, float cdTime)
 {
     StartCoroutine(MissionEnd(missionToDo, 0));
 }
Esempio n. 3
0
 public void MissionStart(MissionToDo missionToDo, float delayedTime)
 {
     StartCoroutine(MissionEnd(missionToDo, delayedTime));
 }