mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-22 10:24:42 -05:00
Added animator to no debug
This commit is contained in:
@@ -35,12 +35,14 @@ public class AerialStateManager : NetworkBehaviour
|
||||
////Components Section
|
||||
public CharacterController moveController; // Character Controller
|
||||
Rigidbody rB; // Players Rigidbody
|
||||
Animator animator; // Animation Controller
|
||||
public Animator animator; // Animation Controller
|
||||
////
|
||||
|
||||
////Scripts Section
|
||||
public PlayerStats pStats; // Player Stats
|
||||
public MoveStateManager mSM;
|
||||
//// AnimatorManagerScript
|
||||
private AnimationManager animationManager;
|
||||
////
|
||||
|
||||
////Variables Section
|
||||
@@ -115,6 +117,7 @@ public class AerialStateManager : NetworkBehaviour
|
||||
////Initialize Scripts
|
||||
pStats = GetComponent<PlayerStats>(); // set PlayerStats
|
||||
mSM = GetComponent<MoveStateManager>(); // set move state manager
|
||||
animationManager = GetComponent<AnimationManager>();
|
||||
////
|
||||
}
|
||||
|
||||
@@ -195,6 +198,7 @@ public class AerialStateManager : NetworkBehaviour
|
||||
|
||||
//updates current state and calls logic for entering
|
||||
currentState = state;
|
||||
animationManager.updateCurrentPriority();
|
||||
currentState.EnterState(this, previousState);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,10 +14,12 @@ public class DashDashingState : DashBaseState
|
||||
|
||||
public override void EnterState(DashStateManager dSM, DashBaseState previousState){
|
||||
currentDashTime = 0; // resets dash time
|
||||
dSM.GetComponent<Animator>().SetBool("isDashing", true);
|
||||
}
|
||||
|
||||
public override void ExitState(DashStateManager dSM, DashBaseState nextState){
|
||||
moveDirection = Vector3.zero; // resets moveDirection
|
||||
dSM.GetComponent<Animator>().SetBool("isDashing", false);
|
||||
}
|
||||
|
||||
public override void UpdateState(DashStateManager dSM){
|
||||
|
||||
@@ -18,13 +18,15 @@ public class DashStateManager : NetworkBehaviour
|
||||
|
||||
////Components Section
|
||||
public CharacterController moveController; // Character Controller
|
||||
Animator animator; // Animation Controller
|
||||
public Animator animator; // Animation Controller
|
||||
////
|
||||
|
||||
////Scripts Section
|
||||
public PlayerStats pStats; // Player Stats
|
||||
public MoveStateManager mSM; // movement state manager
|
||||
public CoolDown driver; // cooldown driver
|
||||
//// AnimatorManagerScript
|
||||
private AnimationManager animationManager;
|
||||
////
|
||||
|
||||
////Items Section
|
||||
@@ -42,6 +44,7 @@ public class DashStateManager : NetworkBehaviour
|
||||
////Initialize Scripts
|
||||
pStats = GetComponent<PlayerStats>(); // set PlayerStats
|
||||
mSM = GetComponent<MoveStateManager>(); // set move state manager
|
||||
animationManager = GetComponent<AnimationManager>();
|
||||
////
|
||||
}
|
||||
|
||||
@@ -77,6 +80,7 @@ public class DashStateManager : NetworkBehaviour
|
||||
|
||||
//updates current state and calls logic for entering
|
||||
currentState = state;
|
||||
animationManager.updateCurrentPriority();
|
||||
currentState.EnterState(this, previousState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,12 +37,14 @@ public class MoveStateManager : NetworkBehaviour
|
||||
public CharacterController moveController; // Character Controller
|
||||
public Rigidbody rB; // Players Rigidbody
|
||||
public CapsuleCollider capCol; // Players Capsule Collider
|
||||
private Animator animator; // Animation Controller
|
||||
public Animator animator; // Animation Controller
|
||||
////
|
||||
|
||||
////Scripts Section
|
||||
public PlayerStats pStats; // Player Stats
|
||||
public AerialStateManager aSM;
|
||||
//// AnimatorManagerScript
|
||||
private AnimationManager animationManager;
|
||||
////
|
||||
|
||||
////State Transition Variables
|
||||
@@ -88,6 +90,7 @@ public class MoveStateManager : NetworkBehaviour
|
||||
capCol.enabled = true;
|
||||
parentObj = transform.parent.gameObject; // set parent object
|
||||
animator = GetComponent<Animator>(); // set animator
|
||||
animationManager = GetComponent<AnimationManager>();
|
||||
////
|
||||
|
||||
////Initialize Scripts
|
||||
@@ -162,6 +165,7 @@ public class MoveStateManager : NetworkBehaviour
|
||||
|
||||
//updates current state and calls logic for entering
|
||||
currentState = state;
|
||||
animationManager.updateCurrentPriority();
|
||||
currentState.EnterState(this, previousState);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,11 +5,13 @@ using UnityEngine;
|
||||
public class MoveIdleState : MoveBaseState
|
||||
{
|
||||
public override void EnterState(MoveStateManager mSM, MoveBaseState previousState){
|
||||
|
||||
mSM.GetComponent<Animator>().SetBool("isIdle", true);
|
||||
Debug.Log("Entered Idle");
|
||||
}
|
||||
|
||||
public override void ExitState(MoveStateManager mSM, MoveBaseState nextState){
|
||||
|
||||
mSM.GetComponent<Animator>().SetBool("isIdle", false);
|
||||
Debug.Log("Exited Idle");
|
||||
}
|
||||
|
||||
public override void UpdateState(MoveStateManager mSM){
|
||||
|
||||
@@ -5,11 +5,13 @@ using UnityEngine;
|
||||
public class MoveJogState : MoveBaseState
|
||||
{
|
||||
public override void EnterState(MoveStateManager mSM, MoveBaseState previousState){
|
||||
|
||||
mSM.GetComponent<Animator>().SetBool("isJogging", true);
|
||||
Debug.Log("Entered Jog");
|
||||
}
|
||||
|
||||
public override void ExitState(MoveStateManager mSM, MoveBaseState nextState){
|
||||
|
||||
mSM.GetComponent<Animator>().SetBool("isJogging", false);
|
||||
Debug.Log("Exited Jog");
|
||||
}
|
||||
|
||||
public override void UpdateState(MoveStateManager mSM){
|
||||
|
||||
@@ -5,11 +5,13 @@ using UnityEngine;
|
||||
public class MoveRunState : MoveBaseState
|
||||
{
|
||||
public override void EnterState(MoveStateManager mSM, MoveBaseState previousState){
|
||||
|
||||
mSM.GetComponent<Animator>().SetBool("isRunning", true);
|
||||
Debug.Log("Entered Run");
|
||||
}
|
||||
|
||||
public override void ExitState(MoveStateManager mSM, MoveBaseState nextState){
|
||||
|
||||
mSM.GetComponent<Animator>().SetBool("isRunning", false);
|
||||
Debug.Log("Exit Run");
|
||||
}
|
||||
|
||||
public override void UpdateState(MoveStateManager mSM){
|
||||
|
||||
@@ -5,11 +5,13 @@ using UnityEngine;
|
||||
public class MoveWalkState : MoveBaseState
|
||||
{
|
||||
public override void EnterState(MoveStateManager mSM, MoveBaseState previousState){
|
||||
|
||||
mSM.GetComponent<Animator>().SetBool("isWalking", true);
|
||||
Debug.Log("Entered Walk");
|
||||
}
|
||||
|
||||
public override void ExitState(MoveStateManager mSM, MoveBaseState nextState){
|
||||
|
||||
mSM.GetComponent<Animator>().SetBool("isWalking", false);
|
||||
Debug.Log("Exited Walk");
|
||||
}
|
||||
|
||||
public override void UpdateState(MoveStateManager mSM){
|
||||
|
||||
@@ -17,7 +17,7 @@ public class NitroStateManager : NetworkBehaviour
|
||||
////
|
||||
|
||||
////Objects Sections
|
||||
GameObject parentObj; // Parent object
|
||||
public GameObject parentObj; // Parent object
|
||||
////
|
||||
|
||||
////Components Section
|
||||
@@ -31,6 +31,8 @@ public class NitroStateManager : NetworkBehaviour
|
||||
public PlayerStats pStats; // Player Stats
|
||||
public MoveStateManager mSM; // move state manager
|
||||
public CoolDown driver; // cooldown driver
|
||||
//// AnimatorManagerScript
|
||||
private AnimationManager animationManager;
|
||||
////
|
||||
|
||||
////Items Section
|
||||
@@ -50,6 +52,7 @@ public class NitroStateManager : NetworkBehaviour
|
||||
capCol.enabled = true;
|
||||
parentObj = transform.parent.gameObject; // set parent object
|
||||
animator = GetComponent<Animator>(); // set animator
|
||||
animationManager = GetComponent<AnimationManager>();
|
||||
//driver = GameObject.Find("Canvas").GetComponent<CoolDown>();
|
||||
////
|
||||
|
||||
@@ -91,6 +94,7 @@ public class NitroStateManager : NetworkBehaviour
|
||||
|
||||
//updates current state and calls logic for entering
|
||||
currentState = state;
|
||||
animationManager.updateCurrentPriority();
|
||||
currentState.EnterState(this, previousState);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ public class OffenseKickState : OffenseBaseState
|
||||
|
||||
oSM.leg.SetActive(true); // activate leg
|
||||
kicked = false; // haven't kicked
|
||||
|
||||
oSM.animator.SetBool("IsKicking", true);
|
||||
//start kicking routine
|
||||
oSM.StartCoroutine(kicking(1f));
|
||||
}
|
||||
@@ -22,6 +22,7 @@ public class OffenseKickState : OffenseBaseState
|
||||
legRotation = 0; // reset leg angle
|
||||
oSM.leg.transform.eulerAngles = new Vector3(legRotation, oSM.leg.transform.eulerAngles.y, oSM.leg.transform.eulerAngles.z); // rotate leg
|
||||
oSM.leg.SetActive(false); // reset leg angle
|
||||
oSM.animator.SetBool("IsKicking", false);
|
||||
}
|
||||
|
||||
public override void UpdateState(OffenseStateManager oSM){
|
||||
|
||||
@@ -32,13 +32,15 @@ public class OffenseStateManager : NetworkBehaviour
|
||||
public CharacterController moveController; // Character Controller
|
||||
Rigidbody rB; // Players Rigidbody
|
||||
CapsuleCollider capCol; // Players Capsule Collider
|
||||
Animator animator; // Animation Controller
|
||||
public Animator animator; // Animation Controller
|
||||
////
|
||||
|
||||
////Scripts Section
|
||||
public PlayerStats pStats; // Player Stats
|
||||
public MoveStateManager mSM; // move state manager
|
||||
public AerialStateManager aSM; // aerial state manager
|
||||
//// AnimatorManagerScript
|
||||
private AnimationManager animationManager;
|
||||
////
|
||||
|
||||
void Awake(){
|
||||
@@ -49,6 +51,7 @@ public class OffenseStateManager : NetworkBehaviour
|
||||
capCol = GetComponent<CapsuleCollider>(); // set Capsule Collider
|
||||
capCol.enabled = true;
|
||||
animator = GetComponent<Animator>(); // set animator
|
||||
animationManager = GetComponent<AnimationManager>();
|
||||
////
|
||||
|
||||
////Initialize Player Objects
|
||||
@@ -97,6 +100,7 @@ public class OffenseStateManager : NetworkBehaviour
|
||||
|
||||
//updates current state and calls logic for entering
|
||||
currentState = state;
|
||||
animationManager.updateCurrentPriority();
|
||||
currentState.EnterState(this, previousState);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user