Beispiel #1
0
    public timer AddTimer(float duration, EventManager.voidHandle func, int loopTime = 1)
    {
        timer m_timer = new timer(duration, loopTime, func);

        timerList.Add(m_timer);
        return(m_timer);
    }
Beispiel #2
0
 public timer(float _duration, int _loopCount, EventManager.voidHandle _func)
 {
     duration  = _duration;
     time      = duration;
     loopCount = _loopCount;
     callBack  = _func;
 }
Beispiel #3
0
    IEnumerator LoadSceneAsync(string sceneName, EventManager.voidHandle OnLoad = null)
    {
        AsyncOperation asyncOp = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(sceneName);

        yield return(asyncOp);

        if (OnLoad != null)
        {
            OnLoad();
        }
    }
Beispiel #4
0
 public void Stop()
 {
     loopCount = 0;
     callBack  = null;
 }