mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 09:54:28 -05:00
created a debug prefab
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class dAerialWallRunState : dAerialBaseState
|
||||
{
|
||||
bool spaceHeld = true;
|
||||
|
||||
public override void EnterState(dAerialStateManager aSM, dAerialBaseState previousState){
|
||||
|
||||
aSM.pStats.GravVel = 0; // on entering reset grav vel
|
||||
spaceHeld = true; // prevent accidental wall jumping
|
||||
|
||||
}
|
||||
|
||||
public override void ExitState(dAerialStateManager aSM, dAerialBaseState nextState){
|
||||
|
||||
}
|
||||
|
||||
public override void UpdateState(dAerialStateManager aSM){
|
||||
|
||||
//if not wallrunning or are ragdolling then falling
|
||||
if(!aSM.isWallRunning || (aSM.mSM.currentState == aSM.mSM.RagdollState)){
|
||||
aSM.SwitchState(aSM.FallingState);
|
||||
}
|
||||
|
||||
//if space is pressed then jumping
|
||||
else if(Input.GetButton("Jump") && !spaceHeld){
|
||||
aSM.SwitchState(aSM.JumpingState);
|
||||
}
|
||||
else if(!Input.GetButton("Jump") && spaceHeld){
|
||||
spaceHeld = false;
|
||||
}
|
||||
|
||||
//if able to grapple then grapple
|
||||
else if(aSM.CheckGrapple()){
|
||||
aSM.SwitchState(aSM.GrappleAirState);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override void FixedUpdateState(dAerialStateManager aSM){
|
||||
|
||||
//Modified gravity calculation for wallrun
|
||||
aSM.GravityCalculation(2);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user