Exemplo n.º 1
0
    public void ChangeAnimation(EPlayerAnimationState ePlayerAnimation, string animationName)
    {
        if (this.ePlayerAnimation == ePlayerAnimation)
        {
            if (_playerAnimator.speed == 0)
            {
                _playerAnimator.speed = 1;
            }

            return;
        }

        this.ePlayerAnimation = ePlayerAnimation;
        _playerAnimator.speed = 1;
        _playerAnimator.SetTrigger(animationName);

        /*
         * _unityArmatureComponent.animation.Play();
         * this.ePlayerAnimation = ePlayerAnimation;
         * _unityArmatureComponent.animation.timeScale = timeScale;
         * _unityArmatureComponent.animation.FadeIn(animationName, fadeTime, looped);  */
    }
Exemplo n.º 2
0
 void Awake()
 {
     this._playerAnimator    = transform.GetChild(0).gameObject.GetComponent <Animator>();
     _unityArmatureComponent = transform.GetChild(0).gameObject.GetComponent <UnityArmatureComponent>();
     this.ePlayerAnimation   = EPlayerAnimationState.IDLE;
 }