Esempio n. 1
0
        /*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);
        }
Esempio n. 2
0
    public virtual void Update(ITime pTime)
    {
        var itor = iggBehaviourList.GetEnumerator();

        while (itor.MoveNext())
        {
            IUpdatableIggBehaviour behavior = itor.Current;
            if (behavior.IsEnabled)
            {
                behavior.UpdateMonoBehaviour(pTime);
            }
        }
    }
Esempio n. 3
0
        /// <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();
    }
Esempio n. 5
0
 public void RemoveMonoBehaviour(IUpdatableIggBehaviour pBehaviour)
 {
     iggBehaviourList.Remove(pBehaviour);
 }
Esempio n. 6
0
 public void AddMonoBehaviour(IUpdatableIggBehaviour pBehaviour)
 {
     UnityEngine.Debug.LogWarning(!iggBehaviourList.Contains(pBehaviour) + "IggBehaviourUpdateGroup" +
                                  "IggBehaviourGroup already contains IggBehaviour {0}" + pBehaviour);
     iggBehaviourList.Add(pBehaviour);
 }