Changes to debug and state machine

This commit is contained in:
Melbyj1125
2022-03-07 12:02:37 -06:00
parent 71d7a84725
commit b9ff40688b
10 changed files with 31 additions and 22 deletions

View File

@@ -8,7 +8,6 @@ public class OffenseCooldownState : OffenseBaseState
public override void EnterState(OffenseStateManager oSM, OffenseBaseState previousState){
cooldown = false; // cooldown isn't over
//start cooldown
oSM.StartCoroutine(kickCooldown());
}

View File

@@ -36,7 +36,6 @@ public class OffenseNoneState : OffenseBaseState
//if in the air
else if((Input.GetKeyDown(KeyCode.F) || Input.GetAxis("Kick") != 0) && !oSM.pStats.IsPaused){
//if power is above 300 air punch
if(oSM.pStats.KickPow > 300){
oSM.SwitchState(oSM.AirPunchState);

View File

@@ -116,6 +116,9 @@ public class OffenseStateManager : NetworkBehaviour
if(collision.transform.CompareTag("ArcherTarget") && myCollider == legHitbox.GetComponent<Collider>()){
Vector3 direction = this.transform.forward;
Debug.Log("---Player Being Kicked: " + collision.transform.root.GetComponent<NetworkObject>().NetworkObjectId);
Debug.Log("---Player Kicking: " + this.transform.root.GetComponent<NetworkObject>().NetworkObjectId);
ulong netObjID = collision.gameObject.transform.root.GetComponent<NetworkObject>().NetworkObjectId;
ApplyKickServerRPC(direction, netObjID);
}
@@ -149,6 +152,7 @@ public class OffenseStateManager : NetworkBehaviour
foreach(GameObject kickedPlayer in players){
//First check if the player is kicked
if(kickedPlayer.transform.root.GetComponent<NetworkObject>() != null && kickedPlayer.transform.root.GetComponent<NetworkObject>().NetworkObjectId == netObjId && kickedPlayer.transform.root.GetComponent<NetworkObject>().NetworkObjectId != this.transform.root.GetComponent<NetworkObject>().NetworkObjectId){
Debug.Log("Kicking other user");
kickedPlayer.GetComponent<MoveStateManager>().GetHit(direction, 10);
}