mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 18:04:27 -05:00
Animation Controller
-Added rough animator diagram--needs more work -Added a animator manager script to handle animation priority
This commit is contained in:
@@ -8,7 +8,7 @@ public class dDashCooldownState : dDashBaseState
|
||||
|
||||
public override void EnterState(dDashStateManager dSM, dDashBaseState previousState){
|
||||
cooldown = false; // sets cooldown
|
||||
dSM.StartCoroutine(startCoolDown(dSM)); // activates cooldown
|
||||
//dSM.StartCoroutine(startCoolDown(dSM)); // activates cooldown
|
||||
}
|
||||
|
||||
public override void ExitState(dDashStateManager dSM, dDashBaseState nextState){
|
||||
|
||||
@@ -14,10 +14,12 @@ public class dDashDashingState : dDashBaseState
|
||||
|
||||
public override void EnterState(dDashStateManager dSM, dDashBaseState previousState){
|
||||
currentDashTime = 0; // resets dash time
|
||||
dSM.GetComponent<Animator>().SetBool("isDashing", true);
|
||||
}
|
||||
|
||||
public override void ExitState(dDashStateManager dSM, dDashBaseState nextState){
|
||||
moveDirection = Vector3.zero; // resets moveDirection
|
||||
dSM.GetComponent<Animator>().SetBool("isDashing", false);
|
||||
}
|
||||
|
||||
public override void UpdateState(dDashStateManager dSM){
|
||||
|
||||
@@ -18,13 +18,15 @@ public class dDashStateManager : 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 dMoveStateManager mSM; // movement state manager
|
||||
public CoolDown driver; // cooldown driver
|
||||
//// AnimatorManagerScript
|
||||
private AnimationManager animationManager;
|
||||
////
|
||||
|
||||
////Items Section
|
||||
@@ -36,6 +38,7 @@ public class dDashStateManager : NetworkBehaviour
|
||||
////Initialize Player Components
|
||||
moveController = GetComponent<CharacterController>(); // set Character Controller
|
||||
animator = GetComponent<Animator>(); // set animator
|
||||
animationManager = GetComponent<AnimationManager>();
|
||||
//driver = GameObject.Find("Canvas").GetComponent<CoolDown>();
|
||||
////
|
||||
|
||||
@@ -77,6 +80,8 @@ public class dDashStateManager : NetworkBehaviour
|
||||
|
||||
//updates current state and calls logic for entering
|
||||
currentState = state;
|
||||
//update current animation priorty in animation manager
|
||||
animationManager.updateCurrentPriority();
|
||||
currentState.EnterState(this, previousState);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user