Beispiel #1
0
 internal void Kill(ISequnceUpdate su)
 {
     DebugUtils.Assert(!IsLockUpdate(), "Kill");
     su.Kill();
     mBehaviours.Remove(su);
     mInactiveBehaviours.Remove(su);
 }
Beispiel #2
0
        public void Update(float seconds)
        {
            int count = mBehaviours.Count;

            mFinishedList.Clear();
            LockUpdate();
            for (int i = 0; i < count; ++i)
            {
                ISequnceUpdate sb = mBehaviours[i];
                sb.Update(seconds);
                if (!sb.IsPlaying)
                {
                    mFinishedList.Add(i);
                }
            }
            UnLockUpdate();
            count = mFinishedList.Count;
            if (count > 0)
            {
                for (int i = count - 1; i >= 0; --i)
                {
                    mInactiveBehaviours.Add(mBehaviours[i]);
                    mBehaviours.RemoveAt(i);
                }
            }
        }
Beispiel #3
0
        internal void Replay(ISequnceUpdate su)
        {
            DebugUtils.Assert(!IsLockUpdate(), "Kill");
            bool contains = mInactiveBehaviours.Remove(su);

            if (contains)
            {
                AddSequence(su);
            }
            su.Replay();
        }
Beispiel #4
0
        public void Replay()
        {
            mCurrent = mRoot;
            ISequnceUpdate parent = mCurrent;

            while (parent != null)
            {
                parent.Replay();
                parent = parent.Sibling;
            }
        }
Beispiel #5
0
 internal void Update(float deltaTime)
 {
     if (mCurrent != null)
     {
         mCurrent.Update(deltaTime);
         if (!mCurrent.IsPlaying)
         {
             mCurrent = mCurrent.Sibling;
         }
     }
 }
Beispiel #6
0
        public void Kill()
        {
            ISequnceUpdate parent = mRoot;

            while (parent != null)
            {
                parent.Kill();
                parent = parent.Sibling;
            }
            mCurrent = null;
            mRoot    = null;
        }
 internal BehaviourCallback(Callback begin = null, Callback process = null, Callback end = null)
 {
     mTimeElappsed    = 0;
     mState           = ThreeState.Ready;
     mBeginCallback   = begin;
     mProcessCallback = process;
     mEndCallback     = end;
     mSequence        = null;
     LoopMaxCount     = 0;
     mLoopAgainCount  = 0;
     SetStartDurationTime(0, 0);
 }
Beispiel #8
0
 private void AddSequence(ISequnceUpdate seq)
 {
     // 这里即使 Update 调用到这里,不会打断 循环
     mBehaviours.Add(seq);
 }
Beispiel #9
0
 internal SequenceTree()
 {
     mRoot    = null;
     mCurrent = null;
 }
Beispiel #10
0
 internal void SetRoot(ISequnceUpdate root)
 {
     mRoot    = root;
     mCurrent = root;
 }