mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 18:04:27 -05:00
Merge branch 'fixAnimator' into main
This commit is contained in:
@@ -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