예제 #1
0
        protected override void Move3D(ACharacterSystem3D cs, MotionInformation mi)
        {
            var correctAmountOfAngularSpeed = cs.LocomotionProfile.LerpAngularSpeed(Mathf.Abs(mi.Input.MovementDirection.z));

            if (mi.Configuration.ShouldAdaptToNavMesh)
            {
                mi.Input.MovementDirection = cs.transform.InverseTransformDirection(mi.Input.MovementDirection);
            }
            cs.transform.Rotate(0f, mi.Input.MovementDirection.x * correctAmountOfAngularSpeed * Time.fixedDeltaTime, 0f, Space.Self);
            cs.transform.Translate(0f, 0f, mi.Input.MovementDirection.z * cs.LocomotionProfile.WalkSpeed * Time.fixedDeltaTime, Space.Self);
        }
예제 #2
0
 protected override void Move3D(ACharacterSystem3D cs, MotionInformation mi)
 {
 }
예제 #3
0
 /// <summary>
 /// Callback to verify if the condition is complete for the 3D space
 /// </summary>
 protected abstract bool IsComplete3D(ACharacterSystem3D cs, MotionInformation mi);
예제 #4
0
 /// <summary>
 /// Callback to execute the movemement of the motion state in 3D space
 /// </summary>
 protected abstract void Move3D(ACharacterSystem3D cs, MotionInformation mi);
예제 #5
0
 protected override bool IsComplete3D(ACharacterSystem3D cs, MotionInformation mi)
 {
     return(mi.Input.MovementDirection.x != 0f || mi.Input.MovementDirection.y != 0f || mi.Input.MovementDirection.z != 0f);
 }