コード例 #1
0
 private void ConstantMove(CharacterControl control, Animator animator, AnimatorStateInfo stateInfo)
 {
     if (!CheckFront(control))
     {
         control.MoveForward(speed, SpeedGraph.Evaluate(stateInfo.normalizedTime));
     }
     else
     {
         control.RIGID_BODY.velocity = new Vector3(0f, control.RIGID_BODY.velocity.y, 0f);
     }
 }
コード例 #2
0
        private void ControlledMove(CharacterControl control, Animator animator, AnimatorStateInfo stateInfo)
        {
            if (control.MoveRight && control.MoveLeft)
            {
                animator.SetBool(TransitionParameter.Move.ToString(), false);
                return;
            }

            if (!control.MoveRight && !control.MoveLeft)
            {
                animator.SetBool(TransitionParameter.Move.ToString(), false);
                return;
            }
            if (control.Spell)
            {
                animator.SetBool(SpellTypeParameters.Hadoken.ToString(), true);
            }

            if (control.Attack_Normal)
            {
                animator.SetBool(TransitionParameter.Attack.ToString(), true);
            }

            if (control.MoveRight)
            {
                control.transform.rotation = Quaternion.Euler(0f, 0f, 0f);
                if (!CheckFront(control))
                {
                    control.MoveForward(speed, SpeedGraph.Evaluate(stateInfo.normalizedTime));
                }
            }

            if (control.MoveLeft)
            {
                control.transform.rotation = Quaternion.Euler(0f, 180f, 0f);
                if (!CheckFront(control))
                {
                    control.MoveForward(speed, SpeedGraph.Evaluate(stateInfo.normalizedTime));
                }
            }
        }