mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 09:54:28 -05:00
weather wheel and weather adjustments
This commit is contained in:
@@ -5,16 +5,14 @@ using UnityEngine;
|
||||
public class MoveSlideState : MoveBaseState
|
||||
{
|
||||
//Slide Variables
|
||||
float originalTraction; // Traction before slide started
|
||||
RaycastHit slideRay; // slide raycast
|
||||
|
||||
public override void EnterState(MoveStateManager mSM, MoveBaseState previousState){
|
||||
|
||||
//Rotate player and adjust height and adjust traction
|
||||
mSM.pStats.CurVel = 0;
|
||||
originalTraction = mSM.pStats.Traction;
|
||||
mSM.moveController.height *= .5f;
|
||||
mSM.pStats.Traction = 0.01f;
|
||||
mSM.pStats.CurTraction = 0.01f;
|
||||
mSM.moveController.center = new Vector3(0,mSM.moveController.center.y - mSM.moveController.height * .5f,0);
|
||||
//mSM.moveController.Move(new Vector3(0,-0.1f,0));
|
||||
}
|
||||
@@ -25,14 +23,14 @@ public class MoveSlideState : MoveBaseState
|
||||
if(nextState != mSM.CrouchState){
|
||||
mSM.gameObject.transform.localEulerAngles = new Vector3(0, 0, 0);
|
||||
mSM.pStats.CurVel = mSM.calculatedCurVel;
|
||||
mSM.pStats.Traction = originalTraction;
|
||||
mSM.pStats.CurTraction = mSM.pStats.Traction;
|
||||
mSM.moveController.height *= 2.0f;
|
||||
mSM.moveController.center = new Vector3(0,mSM.moveController.center.y + mSM.moveController.height * .25f,0);
|
||||
}
|
||||
|
||||
//if state is crouch revert traction
|
||||
else{
|
||||
mSM.pStats.Traction = originalTraction;
|
||||
mSM.pStats.CurTraction = mSM.pStats.Traction;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user