mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 18:04:27 -05:00
maybe fixed issue with movestate reference
This commit is contained in:
@@ -143,6 +143,26 @@ public class AerialStateManager : NetworkBehaviour
|
||||
}
|
||||
|
||||
void Update(){
|
||||
if(currentState == null){
|
||||
//players starting state
|
||||
currentState = GroundedState;
|
||||
previousState = GroundedState;
|
||||
currentState.EnterState(this, previousState);
|
||||
|
||||
////Initialize Variables
|
||||
//Wallrun Variables
|
||||
directions = new Vector3[]{
|
||||
Vector3.right,
|
||||
Vector3.right + Vector3.forward,
|
||||
Vector3.forward,
|
||||
Vector3.left + Vector3.forward,
|
||||
Vector3.left
|
||||
};
|
||||
|
||||
//Grapple Variables
|
||||
hookPoints = GameObject.FindGameObjectsWithTag("HookPoint");
|
||||
////
|
||||
}
|
||||
|
||||
if (!IsLocalPlayer) { return; }
|
||||
|
||||
|
||||
@@ -56,6 +56,13 @@ public class DashStateManager : NetworkBehaviour
|
||||
|
||||
void Update(){
|
||||
|
||||
if(currentState == null){
|
||||
//players starting state
|
||||
currentState = NoneState;
|
||||
previousState = NoneState;
|
||||
currentState.EnterState(this, previousState);
|
||||
}
|
||||
|
||||
if (!IsLocalPlayer) { return; }
|
||||
|
||||
//calls any logic in the update state from current state
|
||||
|
||||
@@ -125,6 +125,20 @@ public class MoveStateManager : NetworkBehaviour
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if(currentState == null){
|
||||
//players starting state
|
||||
currentState = IdleState;
|
||||
previousState = IdleState;
|
||||
currentState.EnterState(this, previousState);
|
||||
|
||||
distToGround = GetComponent<Collider>().bounds.extents.y; // set players distance to ground
|
||||
|
||||
if (!IsLocalPlayer) { return; }
|
||||
Cursor.lockState = CursorLockMode.Locked; // Lock cursor on start if you are the local player
|
||||
pStats.CurTraction = pStats.Traction;
|
||||
pStats.CurAcc = pStats.Acc;
|
||||
}
|
||||
|
||||
if (!IsLocalPlayer) { return; }
|
||||
|
||||
//calculates vel using driftVel will need to be relocated
|
||||
|
||||
@@ -69,6 +69,13 @@ public class NitroStateManager : NetworkBehaviour
|
||||
}
|
||||
|
||||
void Update(){
|
||||
|
||||
if(currentState == null){
|
||||
//players starting state
|
||||
currentState = NoneState;
|
||||
previousState = NoneState;
|
||||
currentState.EnterState(this, previousState);
|
||||
}
|
||||
|
||||
if (!IsLocalPlayer) { return; }
|
||||
|
||||
|
||||
@@ -81,7 +81,13 @@ public class OffenseStateManager : NetworkBehaviour
|
||||
}
|
||||
|
||||
void Update(){
|
||||
|
||||
if(currentState == null){
|
||||
//players starting state
|
||||
currentState = NoneState;
|
||||
previousState = NoneState;
|
||||
currentState.EnterState(this, previousState);
|
||||
}
|
||||
|
||||
if (!IsLocalPlayer) { return; }
|
||||
|
||||
//calls any logic in the update state from current state
|
||||
|
||||
Reference in New Issue
Block a user