示例#1
0
 public override void AfterCharacterUpdate(float deltaTime)
 {
     //machine.ResetJumpLogic(deltaTime);
     if (jump_transition)
     {
         Debug.Log("Attempting to jump from climb");
         machine.StateChange(KeyValue, Jumping);
     }
     else if (standing_transition)
     {
         Debug.Log("Mounting stable surface from climb");
         machine.StateChange(KeyValue, Idle);
     }
 }
示例#2
0
 public override void AfterCharacterUpdate(float deltaTime)
 {
     //machine.ResetJumpLogic(deltaTime);
     if (jump_transition)
     {
         machine.StateChange(KeyValue, PhytoControllerMachine.Jumping);
         jump_transition = false;
         return;
     }
     if (machine.Motor.Velocity.magnitude > 0f || machine._moveInputVector.magnitude > 0f)
     {
         machine.StateChange(KeyValue, PhytoControllerMachine.Walking);
         return;
     }
 }
示例#3
0
        public override void AfterCharacterUpdate(float deltaTime)
        {
            // Handle jumping pre-ground grace period
            if (machine._jumpRequested && machine._timeSinceJumpRequested > machine.JumpPreGroundingGraceTime)
            {
                machine._jumpRequested = false;
                machine._jumpBuffered  = false;
            }

            if (machine.Motor.GroundingStatus.IsStableOnGround && !machine._jumpRequested)
            {
                // If we're on a ground surface, reset jumping values
                machine._jumpConsumed            = false;
                machine._doubleJumpConsumed      = false;
                machine._timeSinceLastAbleToJump = 0f;

                machine.StateChange(KeyValue, Idle);
            }
            //else if (can_climb)
            //    machine.StateChange(KeyValue, Climbing);
            else
            {
                machine._timeSinceLastAbleToJump += deltaTime;
            }
        }