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,10 +4,12 @@ using UnityEngine;
|
||||
|
||||
public class NitroCooldownState : NitroBaseState
|
||||
{
|
||||
bool cooldown = false;
|
||||
bool cooldown = false; // whether or not cooldown has ended
|
||||
|
||||
public override void EnterState(NitroStateManager nSM, NitroBaseState previousState){
|
||||
cooldown = false;
|
||||
cooldown = false; // cooldown hasn't ended
|
||||
|
||||
//start cooldown
|
||||
nSM.StartCoroutine(startCoolDown(nSM));
|
||||
}
|
||||
|
||||
@@ -16,9 +18,13 @@ public class NitroCooldownState : NitroBaseState
|
||||
}
|
||||
|
||||
public override void UpdateState(NitroStateManager nSM){
|
||||
|
||||
//if off cooldown and incapacitated then incapacitated
|
||||
if(cooldown && (nSM.mSM.currentState == nSM.mSM.RagdollState || nSM.mSM.currentState == nSM.mSM.RecoveringState)){
|
||||
nSM.SwitchState(nSM.IncapacitatedState);
|
||||
}
|
||||
|
||||
//if off cooldown then None
|
||||
else if(cooldown){
|
||||
nSM.SwitchState(nSM.NoneState);
|
||||
}
|
||||
@@ -28,6 +34,7 @@ public class NitroCooldownState : NitroBaseState
|
||||
|
||||
}
|
||||
|
||||
//cooldown timer
|
||||
private IEnumerator startCoolDown(NitroStateManager nSM){
|
||||
//nSM.driver.startUICooldown("Nitro");
|
||||
yield return new WaitForSeconds(nSM.nitroItem.cooldownM);
|
||||
|
||||
Reference in New Issue
Block a user