예제 #1
0
        public override void step(float deltaTime)
        {
            if (m_currentAction == null)
            {
                if (getNextAction())
                {
                    m_currentAction.start(getTarget());
                    m_currentAction.step(deltaTime);
                }
                else
                {
                    stop();
                }
            }
            else
            {
                m_currentAction.step(deltaTime);

                if (m_currentAction.isDone())
                {
                    m_currentAction.stop();
                    m_currentAction = null;
                }
            }
        }
예제 #2
0
        public override void start(System.Object obj)
        {
            base.start(obj);

            m_currentIndex  = -1;
            m_currentAction = null;
            m_isDone        = false;
        }
예제 #3
0
        private bool getNextAction()
        {
            int idx = m_currentIndex + 1;

            if (idx < m_actionList.Count)
            {
                m_currentAction = m_actionList [idx];
                m_currentIndex  = idx;
                return(true);
            }
            return(false);
        }
예제 #4
0
 public void addAction(FAction action)
 {
     m_actionList.Add(action);
 }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GRepeat"/> class.
 /// </summary>
 /// <param name="times">重复次数</param>
 /// <param name="action">需要重复播放的动画</param>
 public FRepeat(uint times, FAction action)
 {
     setTimes(times);
     m_innerAction = action;
 }
예제 #6
0
 public FRepeatForever(FAction action)
 {
     m_innerAction = action;
 }
예제 #7
0
 public static void runAction(this System.Object caller, FAction action)
 {
     FActionManager.getInstance().runAction(caller, action);
 }
예제 #8
0
 public void runAction(System.Object caller, FAction action)
 {
     m_actionList.Add(action);
     action.start(caller);
 }