State machine player is networked

small cleanups are still needed
This commit is contained in:
Melbyj1125
2022-02-16 14:21:34 -06:00
parent dfd1687224
commit f0936f4cee
15 changed files with 5790 additions and 5392 deletions

View File

@@ -143,12 +143,17 @@ public class AerialStateManager : NetworkBehaviour
}
void Update(){
if (!IsLocalPlayer) { return; }
//calls any logic in the update state from current state
currentState.UpdateState(this);
}
void FixedUpdate(){
if (!IsLocalPlayer) { return; }
//calls any logic in the fixed update state from current state
currentState.FixedUpdateState(this);
if(moveController.enabled){

View File

@@ -63,11 +63,17 @@ public class DashStateManager : NetworkBehaviour
}
void Update(){
if (!IsLocalPlayer) { return; }
//calls any logic in the update state from current state
currentState.UpdateState(this);
}
void FixedUpdate(){
if (!IsLocalPlayer) { return; }
//calls any logic in the fixed update state from current state
currentState.FixedUpdateState(this);
}

View File

@@ -107,12 +107,15 @@ public class MoveStateManager : NetworkBehaviour
slideUp = GetComponentInParent<Transform>().up; // get parents up direction
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
}
// Update is called once per frame
void Update()
{
//if (!IsLocalPlayer) { return; }
//calculates vel using driftVel will need to be relocated
calculatedCurVel = driftVel.magnitude * 50f;
@@ -124,6 +127,8 @@ public class MoveStateManager : NetworkBehaviour
void FixedUpdate(){
//if (!IsLocalPlayer) { return; }
//calls any logic in the fixed update state from current state
currentState.FixedUpdateState(this);

View File

@@ -67,11 +67,17 @@ public class NitroStateManager : NetworkBehaviour
}
void Update(){
if (!IsLocalPlayer) { return; }
//calls any logic in the update state from current state
currentState.UpdateState(this);
}
void FixedUpdate(){
if (!IsLocalPlayer) { return; }
//calls any logic in the fixed update state from current state
currentState.FixedUpdateState(this);
}

View File

@@ -72,11 +72,17 @@ public class OffenseStateManager : NetworkBehaviour
}
void Update(){
if (!IsLocalPlayer) { return; }
//calls any logic in the update state from current state
currentState.UpdateState(this);
}
void FixedUpdate(){
if (!IsLocalPlayer) { return; }
//calls any logic in the fixed update state from current state
currentState.FixedUpdateState(this);
}