Esempio n. 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;
                }
            }
        }
Esempio n. 2
0
        public override void start(System.Object obj)
        {
            base.start(obj);

            m_currentIndex  = -1;
            m_currentAction = null;
            m_isDone        = false;
        }
Esempio n. 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);
        }
Esempio n. 4
0
 public void addAction(FAction action)
 {
     m_actionList.Add(action);
 }
Esempio n. 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;
 }
Esempio n. 6
0
 public FRepeatForever(FAction action)
 {
     m_innerAction = action;
 }
Esempio n. 7
0
 public static void runAction(this System.Object caller, FAction action)
 {
     FActionManager.getInstance().runAction(caller, action);
 }
Esempio n. 8
0
 public void runAction(System.Object caller, FAction action)
 {
     m_actionList.Add(action);
     action.start(caller);
 }