Did some bugfixing and commented on everything

This commit is contained in:
Melbyj1125
2022-02-17 20:55:23 -06:00
parent e74a1c61c0
commit 820b11dd61
40 changed files with 528 additions and 250 deletions

View File

@@ -4,11 +4,11 @@ using UnityEngine;
public class DashCooldownState : DashBaseState
{
bool cooldown = false;
bool cooldown = false; // is cooldown over
public override void EnterState(DashStateManager dSM, DashBaseState previousState){
cooldown = false;
dSM.StartCoroutine(startCoolDown(dSM));
cooldown = false; // sets cooldown
dSM.StartCoroutine(startCoolDown(dSM)); // activates cooldown
}
public override void ExitState(DashStateManager dSM, DashBaseState nextState){
@@ -16,9 +16,13 @@ public class DashCooldownState : DashBaseState
}
public override void UpdateState(DashStateManager dSM){
//if after cooldown player is incapacitated still then Incapacitated
if(cooldown && (dSM.mSM.currentState == dSM.mSM.RagdollState || dSM.mSM.currentState == dSM.mSM.RecoveringState || dSM.mSM.currentState == dSM.mSM.SlideState || dSM.mSM.currentState == dSM.mSM.CrouchState || dSM.mSM.currentState == dSM.mSM.CrouchWalkState)){
dSM.SwitchState(dSM.IncapacitatedState);
}
//if cooldown is over then None
else if(cooldown){
dSM.SwitchState(dSM.NoneState);
}
@@ -28,6 +32,7 @@ public class DashCooldownState : DashBaseState
}
//cooldown function
private IEnumerator startCoolDown(DashStateManager dSM){
//dSM.driver.startUICooldown(dashItem.name);
yield return new WaitForSeconds(dSM.dashItem.cooldownM);