Ejemplo n.º 1
0
    public void SeqTest()
    {
        m_SeqAction = new SequenceAction();
        ActionTween mRotActionTween = this.transform.RotationTween(m_RotToValue, mDuration, m_RotModle);

        mRotActionTween
        .SetEase(mEaseType)
        .SetActionDirectionType(mDirectionType)
        .SetActionScaleTime(mScaleTime)
        .SetActionType(mActionType)
        .SetLoopTime(mLoopTime)
        .SetSpeedAble(m_UseSpeed)
        .SetSpeed(m_Speed)
        .SetRelative(m_Relative)
        .SetAutoKill(mAutoKill)
        .SetKillCallback(() =>
        {
            LOG.Log("mRotActionTween Kill");
        })
        .SetCompleteCallback(() =>
        {
            // LOG.Log("mRotActionTween Finish");
        });

        var moveAction = this.transform.MoveTween(mTargetTran, mDuration);

        moveAction
        .SetEase(mEaseType)
        .SetActionDirectionType(mDirectionType)
        .SetActionScaleTime(mScaleTime)
        .SetActionType(mActionType)
        .SetLoopTime(0)
        .SetSpeedAble(m_UseSpeed)
        .SetSpeed(m_Speed)
        .SetRelative(m_Relative)
        .SetAutoKill(mAutoKill);

        var colorAction = this.transform.ColorTween(Color.blue, mDuration);

        colorAction.SetActionType(mActionType);

        m_SeqAction.Add(0, mRotActionTween);
        m_SeqAction.Add(2, moveAction);
        m_SeqAction.Append(colorAction);
        m_SeqAction
        // .SetActionType(mActionType)
        .SetAutoKill(mAutoKill)
        .SetStepUpdateCallback(() =>
        {
            mActionCurTime = Time.realtimeSinceStartup - mTempTime;
        })
        .SetBeginPlayCallback(() =>
        {
            mTempTime = Time.realtimeSinceStartup;
            // LOG.Log(this.gameObject.name + " anim Begin m_SeqAction");
        })
        .SetCompleteCallback(() =>
        {
            mActionExTime = Time.realtimeSinceStartup - mTempTime;
            //LOG.Log(this.gameObject.name + " anim Complete m_SeqAction");
        })
        .SetKillCallback(() =>
        {
            LOG.Log(this.gameObject.name + " anim Kill m_SeqAction");
        });
        m_SeqAction.SetAutoPlay(m_AutoPlay);
        mTestActionTween = m_SeqAction;
    }