public virtual void OnUpdate(GTAnimator animator) { if (animator == null) { return; } if (OnUpdateDelegate != null) { OnUpdateDelegate(this); } if (ActiveActions != null && ActiveActions.Count > 0) { for (int i = 0; i < ActiveActions.Count; i++) { ClipAction action = ActiveActions[i]; if (action == null) { ActiveActions.RemoveAt(i); i--; continue; } if (action.EndTime <= animator.CurrentTime) { action.OnEnd(this); ActiveActions.Remove(action); i--; } else if (action.m_Status == ClipAction.Status.Error || action.m_Status == ClipAction.Status.StopOnNextFrame) { action.OnEnd(this); ActiveActions.Remove(action); i--; } else { action.OnUpdate(this); } } } if (WaittingProcessActions != null && WaittingProcessActions.Count > 0) { for (int i = 0; i < WaittingProcessActions.Count; i++) { ClipAction action = WaittingProcessActions[i]; if (action == null) { WaittingProcessActions.RemoveAt(i); i--; continue; } if (action.BeginTime <= animator.CurrentTime && action.m_Status == ClipAction.Status.UnAction) { action.OnBegin(this); ActiveActions.Add(action); WaittingProcessActions.Remove(action); i--; } } } }
public virtual void OnEnd(GTAnimator animator) { if (ActiveActions != null || ActiveActions.Count > 0) { for (int i = 0; i < ActiveActions.Count; i++) { ClipAction action = ActiveActions[i]; if (action == null) { continue; } action.OnEnd(this); } } if (AnimateObj != null) { switch (ActiveObjOperation) { case GameObjectActiveOperation.AlwaysChangeStatus: if (AnimateObj.activeSelf == true) { AnimateObj.SetActive(false); } break; case GameObjectActiveOperation.OnlyActiveOnBegin: break; case GameObjectActiveOperation.DontOperate: break; default: break; } } if (OnEndDelegate != null) { OnEndDelegate(this); } m_Status = Status.UnAction; }