mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 18:04:27 -05:00
Did some bugfixing and commented on everything
This commit is contained in:
@@ -4,11 +4,12 @@ using UnityEngine;
|
||||
|
||||
public class OffenseCooldownState : OffenseBaseState
|
||||
{
|
||||
bool cooldown = false;
|
||||
bool cooldown = false; // whether or not cooldown is over
|
||||
|
||||
public override void EnterState(OffenseStateManager oSM, OffenseBaseState previousState){
|
||||
cooldown = false;
|
||||
cooldown = false; // cooldown isn't over
|
||||
|
||||
//start cooldown
|
||||
oSM.StartCoroutine(kickCooldown());
|
||||
}
|
||||
|
||||
@@ -17,9 +18,13 @@ public class OffenseCooldownState : OffenseBaseState
|
||||
}
|
||||
|
||||
public override void UpdateState(OffenseStateManager oSM){
|
||||
|
||||
//if cooldown over and incapacitated then incapacitated
|
||||
if(cooldown && (oSM.mSM.currentState == oSM.mSM.RagdollState || oSM.mSM.currentState == oSM.mSM.SlideState || oSM.mSM.currentState == oSM.mSM.CrouchState || oSM.mSM.currentState == oSM.mSM.CrouchWalkState) || (oSM.aSM.currentState == oSM.aSM.WallRunState || oSM.aSM.currentState == oSM.aSM.WallIdleState || oSM.aSM.currentState == oSM.aSM.GrappleAirState || oSM.aSM.currentState == oSM.aSM.GrappleGroundedState)){
|
||||
oSM.SwitchState(oSM.IncapacitatedState);
|
||||
}
|
||||
|
||||
//if cooldown over then None
|
||||
else if(cooldown){
|
||||
oSM.SwitchState(oSM.NoneState);
|
||||
}
|
||||
@@ -29,6 +34,7 @@ public class OffenseCooldownState : OffenseBaseState
|
||||
|
||||
}
|
||||
|
||||
//kick cooldown
|
||||
private IEnumerator kickCooldown(){
|
||||
yield return new WaitForSeconds(.5f);
|
||||
cooldown = true;
|
||||
|
||||
Reference in New Issue
Block a user