public void Delay(float delayTime, Action callBack) { TimerCollection.Callback delayFunc = () => { callBack(); }; Timer _timer = TimerCollection.GetInstance().Create(delayFunc, true, null); _timer.Start(delayTime); }
public void PlayAudio(string name, Action callBack, float delayTime = 0.5f) { name = "GUIDE/MessageTree/" + name; AudioPlayer.Instance.PlayAudio(name, Vector3.zero, false, (res) => { if (delayTime <= 0.0f) { callBack(); } else { TimerCollection.Callback delayFunc = () => { callBack(); }; Timer _timer = TimerCollection.GetInstance().Create(delayFunc, true, null); _timer.Start(delayTime); } }); }
public Timer(TimerCollection.Callback _func, bool autoR, TimerCollection.CallbackWithTime _funcWithTime) { func = _func; funcWithTime = _funcWithTime; autoRelease = autoR; }
public Timer(TimerCollection.Callback _func, TimerCollection.CallbackWithTime _funcWithTime) { func = _func; funcWithTime = _funcWithTime; autoRelease = false; }