mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-09-07 09:55:24 -05:00
added slide check functionality for certain functions
This commit is contained in:
@@ -12,7 +12,7 @@ public class AerialFallingState : AerialBaseState
|
||||
if(aSM.pStats.GravVel > 0){
|
||||
aSM.SwitchState(aSM.JumpingState);
|
||||
}
|
||||
else if(Input.GetButton("Jump") && aSM.pStats.HasGlider){
|
||||
else if(Input.GetButton("Jump") && aSM.pStats.HasGlider && (aSM.mSM.currentState != aSM.mSM.SlideState && aSM.mSM.currentState != aSM.mSM.RagdollState && aSM.mSM.currentState != aSM.mSM.RecoveringState)){
|
||||
aSM.SwitchState(aSM.GlidingState);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ using UnityEngine;
|
||||
public class AerialStateManager : MonoBehaviour
|
||||
{
|
||||
////Player States
|
||||
AerialBaseState currentState;
|
||||
public AerialBaseState currentState;
|
||||
public AerialBaseState previousState;
|
||||
|
||||
//Aerial States
|
||||
@@ -91,7 +91,6 @@ public class AerialStateManager : MonoBehaviour
|
||||
DownwardMovement();
|
||||
}
|
||||
else{
|
||||
Debug.Log(currentState);
|
||||
//Gravity without moveController
|
||||
pStats.GravVel -= pStats.PlayerGrav * Time.deltaTime;
|
||||
rB.AddForce(new Vector3(0,pStats.GravVel,0));
|
||||
|
||||
Reference in New Issue
Block a user