public void Update(float time) { if (State == ThreeState.Ready) { BehaviourSort sort = new BehaviourSort(); Behaviours.Sort(sort); State = ThreeState.Playing; } if (IsPlaying) { TimeLine += time; if (TimeLine < PrependTime) { return; } float timeElappsed = TimeLine - PrependTime; bool completed = true; foreach (BehaviourTimeCallback beh in Behaviours) { // 只要有一个没执行完,就代表没结束 if (!beh.IsFinished && beh.Update(timeElappsed)) { completed = false; } } if (completed && OnCompletedCallback != null) { State = ThreeState.Finished; OnCompletedCallback.Run(); } } }
public virtual void End() { if (EndCallback != null) { EndCallback.Run(); } }
public virtual void Process() { if (ProcessCallback != null) { ProcessCallback.Run(); } }
public virtual void Begin() { if (BeginCallback != null) { BeginCallback.Run(); } }
public void OnPathTrigger(AbstractCallback callback) { if (callback != null) { callback.Run(); ObjectPools.Instance.Release(callback); } DebugUtils.Info("FixedPathMoableTest", "OnPathTrigger AbstractCallback"); }
public bool Process <T>(T obj) { Start(); if (TimeUtils.GetTimeStampSeconds() > mNextSeconds) { if (mCallback != null) { mCallback.Run(); } Stop(); return(true); } return(false); }