コード例 #1
0
 public override void GetDeadAnimation()
 {
     if (!CheckState("Dead"))
     {
         CurAnimator.SetBool("BDead", true);
     }
 }
コード例 #2
0
        //触发跳跃躲闪动作
        public override void GetJumpAnimation()
        {
            if (CurAnimator.GetBool("Move"))
            {
                if (_player.Controller.BJump)
                {
                    if (!_player.CameraControl.LockState)
                    {
                        CurAnimator.SetTrigger("Jump");
                    }
                    else
                    {
                        if (CheckState("EqipMove"))
                        {
                            CurAnimator.SetTrigger("Dodge_Roll");
                        }
                    }
                }

                else if (_player.Controller.BStep)
                {
                    if (_player.CameraControl.LockState)
                    {
                        if (CheckState("EqipMove"))
                        {
                            CurAnimator.SetTrigger("Dodge_Step");
                        }
                    }
                }
            }
        }
コード例 #3
0
        public override void SetBlockAnimation()
        {
            //只有在IDLE状态下才能防御
            if (CheckState("EqipMove"))
            {
                //根据防御键状态来判定是否触发防御动画
                CurAnimator.SetBool("Block", _player.Controller.BDefense);

                //按下防御键权重插值到1
                if (_player.Controller.BDefense)
                {
                    SetAnimLayerWeight("Defense", 1, 0.2f);
                }
                //松开防御键权重插值回0
                else
                {
                    SetAnimLayerWeight("Defense", 0, 0.2f);
                }
            }
            //其他动画状态权重都会拉回0
            else
            {
                //权重插值回0
                SetAnimLayerWeight("Defense", 0, 0.3f);
            }
        }
コード例 #4
0
 public override void GetDamageAnimation(float x, float z)
 {
     if (!CheckState("DamageDirc"))
     {
         CurAnimator.SetFloat("AtkDircX", x);
         CurAnimator.SetFloat("AtkDircZ", z);
         CurAnimator.SetTrigger("UnderAttack");
     }
 }
コード例 #5
0
        public override void ChangeActionState()
        {
            if (_player.Controller.GetSelect1())
            {
                if (CheckState("UneqipMove"))
                {
                    CurAnimator.SetTrigger("ToEqip");
                    CurAnimator.SetBool("B_Eqip", true);
                }

                else if (CheckState("EqipMove"))
                {
                    CurAnimator.SetTrigger("ToUnEqip");
                    CurAnimator.SetBool("B_Eqip", false);
                }
            }
        }