Esempio n. 1
0
        private void PlayDeathEffect(Action complete)
        {
            var deathEffect = new SequenceAction();

            for (int i = 0; i < 3; i++)
            {
                deathEffect.Add(new ScaleToAction(Unit.transform, Vector3.one * 1.5f, 0.15f));
                deathEffect.Add(new ScaleToAction(Unit.transform, Vector3.one, 0.15f));
            }
            _actionsSequencer.Execute(deathEffect, action =>
            {
                complete?.Invoke();
            });
        }
Esempio n. 2
0
        private void PlayDeathEffect()
        {
            var deathEffect = new SequenceAction();

            deathEffect.Add(new PlayParticleEffectAction("Explosion", Unit.transform.position, null, 3f, _factory));
            _actionsSequencer.Execute(deathEffect);
        }
Esempio n. 3
0
        public void ShowCubeBubble(Vector3 position, float flyHeight)
        {
            var effectObj = _factory.Create("CubeClickBubble");

            effectObj.transform.parent   = _visualRoot.Root;
            effectObj.transform.position = position;

            var effAction = new SequenceAction();

            effAction.Add(new MoveToAction(effectObj.transform, new Vector3(position.x, position.y + flyHeight, position.z), 0.7f));
            effAction.Add(new FadeToAction(effectObj, 1f, 0f, 0.2f));

            effAction.Add(new ExecuteAction(() =>
            {
                _factory.Remove(effectObj);
            }));

            _actionsSequencer.Execute(effAction);
        }
Esempio n. 4
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;
    }