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,42 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class dOffenseCooldownState : dOffenseBaseState
{
bool cooldown = false; // whether or not cooldown is over
public override void EnterState(dOffenseStateManager oSM, dOffenseBaseState previousState){
cooldown = false; // cooldown isn't over
//start cooldown
oSM.StartCoroutine(kickCooldown());
}
public override void ExitState(dOffenseStateManager oSM, dOffenseBaseState nextState){
}
public override void UpdateState(dOffenseStateManager 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);
}
}
public override void FixedUpdateState(dOffenseStateManager oSM){
}
//kick cooldown
private IEnumerator kickCooldown(){
yield return new WaitForSeconds(.5f);
cooldown = true;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6057e16fd22e5bc4893db0d4392988d2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class dOffenseIncapacitatedState : dOffenseBaseState
{
public override void EnterState(dOffenseStateManager oSM, dOffenseBaseState previousState){
}
public override void ExitState(dOffenseStateManager oSM, dOffenseBaseState nextState){
}
public override void UpdateState(dOffenseStateManager oSM){
//if no longer incapacitated then None
if((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.NoneState);
}
}
public override void FixedUpdateState(dOffenseStateManager oSM){
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a65473cdff4d4d343bd9fea0d2abf01b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,55 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class dOffenseNoneState : dOffenseBaseState
{
public override void EnterState(dOffenseStateManager oSM, dOffenseBaseState previousState){
}
public override void ExitState(dOffenseStateManager oSM, dOffenseBaseState nextState){
}
public override void UpdateState(dOffenseStateManager oSM){
//if incapacitated then incapacitated
if((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 grounded then grounded kick states
else if(oSM.aSM.currentState == oSM.aSM.GroundedState && (Input.GetKeyDown(KeyCode.F) || Input.GetAxis("Kick") != 0)){
//if power is above 300 then punch
if(oSM.pStats.KickPow > 300){
oSM.SwitchState(oSM.PunchState);
}
//otherwise kick
else{
oSM.SwitchState(oSM.KickState);
}
}
//if in the air
else if((Input.GetKeyDown(KeyCode.F) || Input.GetAxis("Kick") != 0)){
//if power is above 300 air punch
if(oSM.pStats.KickPow > 300){
oSM.SwitchState(oSM.AirPunchState);
}
//otherwise air kick
else{
oSM.SwitchState(oSM.AirKickState);
}
}
}
public override void FixedUpdateState(dOffenseStateManager oSM){
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 207ecd38b476de8458c6f495c74f01c5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: