예제 #1
0
    public virtual void Update(ITime pTime)
    {
        var itor = iggBehaviourList.GetEnumerator();

        while (itor.MoveNext())
        {
            IUpdatableIggBehaviour behavior = itor.Current;
            if (behavior.IsEnabled)
            {
                behavior.UpdateMonoBehaviour(pTime);
            }
        }
    }
예제 #2
0
    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();
    }