created a debug prefab

This commit is contained in:
Melbyj1125
2022-02-18 13:56:10 -06:00
parent 820b11dd61
commit 167f7840a0
108 changed files with 9076 additions and 123 deletions

View File

@@ -0,0 +1,47 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class dNitroNitroingState : dNitroBaseState
{
private float tempTimer; // temporary timer
private float actualMaxVel; // actual max velocity
private float actualAcc; // actual acceleration
public override void EnterState(dNitroStateManager nSM, dNitroBaseState previousState){
actualMaxVel = nSM.pStats.MaxVel; // saves previous max velocity
actualAcc = nSM.pStats.Acc; // saves previous max acc
nSM.pStats.Acc += nSM.nitroAccBoost; // increases acceleration
nSM.pStats.MaxVel += nSM.nitroVelBoost; // increases max velocity
tempTimer = 5; // how long we will be sped up
}
public override void ExitState(dNitroStateManager nSM, dNitroBaseState nextState){
nSM.pStats.Acc = actualAcc; // reset acceleration
nSM.pStats.MaxVel = actualMaxVel; // reset maximum velocity
}
public override void UpdateState(dNitroStateManager nSM){
//if still nitroing decrease timer
if(tempTimer > 0){
tempTimer -= .02f;
}
//otherwise cooldown
else{
nSM.SwitchState(nSM.CooldownState);
}
//if ragdolling then cooldown
if(nSM.mSM.currentState == nSM.mSM.RagdollState){
nSM.SwitchState(nSM.CooldownState);
}
}
public override void FixedUpdateState(dNitroStateManager nSM){
}
}