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:
@@ -14,6 +14,7 @@ public class dOffenseKickState : dOffenseBaseState
|
||||
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 +23,7 @@ public class dOffenseKickState : dOffenseBaseState
|
||||
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(dOffenseStateManager oSM){
|
||||
|
||||
@@ -5,6 +5,7 @@ using MLAPI;
|
||||
|
||||
public class dOffenseStateManager : NetworkBehaviour
|
||||
{
|
||||
|
||||
////Player States
|
||||
public dOffenseBaseState currentState;
|
||||
public dOffenseBaseState previousState;
|
||||
@@ -31,14 +32,16 @@ public class dOffenseStateManager : 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 dMoveStateManager mSM; // move state manager
|
||||
public dAerialStateManager aSM; // aerial state manager
|
||||
////
|
||||
//// AnimatorManagerScript
|
||||
private AnimationManager animationManager;
|
||||
///
|
||||
|
||||
void Awake(){
|
||||
|
||||
@@ -48,6 +51,7 @@ public class dOffenseStateManager : NetworkBehaviour
|
||||
capCol = GetComponent<CapsuleCollider>(); // set Capsule Collider
|
||||
capCol.enabled = true;
|
||||
animator = GetComponent<Animator>(); // set animator
|
||||
animationManager = GetComponent<AnimationManager>();
|
||||
////
|
||||
|
||||
////Initialize Player Objects
|
||||
@@ -96,6 +100,8 @@ public class dOffenseStateManager : 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