mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 09:54:28 -05:00
Fixed a lot of the issues we addressed on Monday
This commit is contained in:
@@ -12,18 +12,20 @@ public class dMoveRagdollState : dMoveBaseState
|
||||
public override void EnterState(dMoveStateManager mSM, dMoveBaseState previousState){
|
||||
|
||||
ragTime = mSM.pStats.RecovTime; // how long to be ragdolled
|
||||
mSM.prevRot = mSM.transform.localEulerAngles; // save previous rotation
|
||||
prevRot = mSM.transform.localEulerAngles; // save previous rotation
|
||||
mSM.capCol.enabled = true; // enable capsule collider
|
||||
mSM.moveController.enabled = false; // disable move controller
|
||||
mSM.rB.isKinematic = false; // disable kinematic
|
||||
mSM.rB.detectCollisions = true; // detect collisions
|
||||
mSM.rB.collisionDetectionMode = CollisionDetectionMode.ContinuousDynamic;
|
||||
|
||||
//apply force
|
||||
mSM.rB.AddForce(mSM.dirHit, ForceMode.Impulse);
|
||||
}
|
||||
|
||||
public override void ExitState(dMoveStateManager mSM, dMoveBaseState nextState){
|
||||
|
||||
mSM.transform.localEulerAngles = prevRot; // reset player rotation
|
||||
mSM.rB.collisionDetectionMode = CollisionDetectionMode.Discrete;
|
||||
}
|
||||
|
||||
public override void UpdateState(dMoveStateManager mSM){
|
||||
|
||||
@@ -12,7 +12,6 @@ public class dMoveRecoveringState : dMoveBaseState
|
||||
mSM.moveController.enabled = true; // enable move controller
|
||||
mSM.rB.isKinematic = true; // enable kinematic
|
||||
mSM.rB.detectCollisions = false; // detect collisions false
|
||||
mSM.transform.localEulerAngles = mSM.prevRot; // reset player rotation
|
||||
mSM.CancelMomentum(); // reset player variables
|
||||
mSM.moveController.Move(new Vector3(0,2,0));
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@ public class dMoveIdleState : dMoveBaseState
|
||||
{
|
||||
public override void EnterState(dMoveStateManager mSM, dMoveBaseState previousState){
|
||||
mSM.GetComponent<Animator>().SetBool("isIdle", true);
|
||||
Debug.Log("Entered Idle");
|
||||
//Debug.Log("Entered Idle");
|
||||
}
|
||||
|
||||
public override void ExitState(dMoveStateManager mSM, dMoveBaseState nextState){
|
||||
mSM.GetComponent<Animator>().SetBool("isIdle", false);
|
||||
Debug.Log("Exited Idle");
|
||||
//Debug.Log("Exited Idle");
|
||||
}
|
||||
|
||||
public override void UpdateState(dMoveStateManager mSM){
|
||||
|
||||
@@ -6,12 +6,12 @@ public class dMoveJogState : dMoveBaseState
|
||||
{
|
||||
public override void EnterState(dMoveStateManager mSM, dMoveBaseState previousState){
|
||||
mSM.GetComponent<Animator>().SetBool("isJogging", true);
|
||||
Debug.Log("Entered Jog");
|
||||
//Debug.Log("Entered Jog");
|
||||
}
|
||||
|
||||
public override void ExitState(dMoveStateManager mSM, dMoveBaseState nextState){
|
||||
mSM.GetComponent<Animator>().SetBool("isJogging", false);
|
||||
Debug.Log("Exited Jog");
|
||||
//Debug.Log("Exited Jog");
|
||||
}
|
||||
|
||||
public override void UpdateState(dMoveStateManager mSM){
|
||||
|
||||
@@ -6,12 +6,12 @@ public class dMoveRunState : dMoveBaseState
|
||||
{
|
||||
public override void EnterState(dMoveStateManager mSM, dMoveBaseState previousState){
|
||||
mSM.GetComponent<Animator>().SetBool("isRunning", true);
|
||||
Debug.Log("Entered Run");
|
||||
//Debug.Log("Entered Run");
|
||||
}
|
||||
|
||||
public override void ExitState(dMoveStateManager mSM, dMoveBaseState nextState){
|
||||
mSM.GetComponent<Animator>().SetBool("isRunning", false);
|
||||
Debug.Log("Exit Run");
|
||||
//Debug.Log("Exit Run");
|
||||
}
|
||||
|
||||
public override void UpdateState(dMoveStateManager mSM){
|
||||
|
||||
@@ -9,12 +9,12 @@ public class dMoveWalkState : dMoveBaseState
|
||||
public override void EnterState(dMoveStateManager mSM, dMoveBaseState previousState){
|
||||
//get component is semi expensive--may want to ahve all statemanagers have a reference to animator
|
||||
mSM.GetComponent<Animator>().SetBool("isWalking", true);
|
||||
Debug.Log("Entered Walk");
|
||||
//Debug.Log("Entered Walk");
|
||||
}
|
||||
|
||||
public override void ExitState(dMoveStateManager mSM, dMoveBaseState nextState){
|
||||
mSM.GetComponent<Animator>().SetBool("isWalking", false);
|
||||
Debug.Log("Exited Walk");
|
||||
//Debug.Log("Exited Walk");
|
||||
}
|
||||
|
||||
public override void UpdateState(dMoveStateManager mSM){
|
||||
|
||||
@@ -78,7 +78,6 @@ public class dMoveStateManager : NetworkBehaviour
|
||||
//Ragdoll Variables
|
||||
public Vector3 dirHit; // Direction hit
|
||||
public float distToGround; // distance to ground
|
||||
public Vector3 prevRot; // previous rotation before ragdolled
|
||||
////
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user