/*public static void PushAnimatorsGroup() * { * //IGG.Logging.Logger.LogWarning("Pushing new animators group."); * animatorGroupStack.Push(new FrameRateBasedUpdateGroup<MeshAnimator>()); * } * * public static void PopAnimatorsGroup() * { * //IGG.Logging.Logger.LogWarning("Popping animators group."); * animatorGroupStack.Pop (); * }*/ public static void AddAnimator(IUpdatableIggBehaviour pAnimator) { if (singleton == null) { CreateUpdaterSingleton(); } animatorGroup.AddMonoBehaviour(pAnimator); }
public virtual void Update(ITime pTime) { var itor = iggBehaviourList.GetEnumerator(); while (itor.MoveNext()) { IUpdatableIggBehaviour behavior = itor.Current; if (behavior.IsEnabled) { behavior.UpdateMonoBehaviour(pTime); } } }
/// <summary> /// /// </summary> /// <param name="pAnimator"></param> /// <returns>IsLastOneWithClear</returns> public static bool RemoveAnimator(IUpdatableIggBehaviour pAnimator) { animatorGroup.RemoveMonoBehaviour(pAnimator); if (animatorGroup.IsListEmpty()) { MeshAnimationLoader.instance.Clear(); Destroy(singleton); singleton = null; return(true); } return(false); }
public override void Update(ITime pTime) { //int framerate = UnityEngine.Time.captureFramerate; int start = 0; int increment = 1; // If framerate is going bad. if (pTime.DeltaTime > m_frameDeltaTime) { start = pTime.CurrentFrame & 0x1; increment = 2; } int i = 0; int nextUpdate = start; var itor = iggBehaviourList.GetEnumerator(); while (itor.MoveNext()) { IUpdatableIggBehaviour behavior = itor.Current; if (nextUpdate == i && behavior != null) { if (behavior.IsEnabled) { behavior.UpdateMonoBehaviour(pTime); } nextUpdate += increment; } i++; } itor.Dispose(); }
public void RemoveMonoBehaviour(IUpdatableIggBehaviour pBehaviour) { iggBehaviourList.Remove(pBehaviour); }
public void AddMonoBehaviour(IUpdatableIggBehaviour pBehaviour) { UnityEngine.Debug.LogWarning(!iggBehaviourList.Contains(pBehaviour) + "IggBehaviourUpdateGroup" + "IggBehaviourGroup already contains IggBehaviour {0}" + pBehaviour); iggBehaviourList.Add(pBehaviour); }