mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-09-08 02:15:16 -05:00
Debug Scripts have been cleaned up.
I won't apply this cleanup to the networked version yet because they will be updated to a state machine anyways.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public abstract class MoveBaseState
|
||||
{
|
||||
public abstract void EnterState(MoveStateManager mSM);
|
||||
public abstract void UpdateState(MoveStateManager mSM);
|
||||
public abstract void FixedUpdateState(MoveStateManager mSM);
|
||||
public abstract void OnCollisionEnter(MoveStateManager mSM);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7faaa4b89293d9e4992142ab5c4fcc35
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,38 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MoveStateManager : MonoBehaviour
|
||||
{
|
||||
MoveBaseState currentState;
|
||||
MoveIdleState IdleState = new MoveIdleState();
|
||||
MoveWalkState WalkState = new MoveWalkState();
|
||||
MoveJogState JogState = new MoveJogState();
|
||||
MoveRunState RunState = new MoveRunState();
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
//players starting state
|
||||
currentState = IdleState;
|
||||
currentState.EnterState(this);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
//calls any logic in the update state from current state
|
||||
currentState.UpdateState(this);
|
||||
}
|
||||
|
||||
void FixedUpdate(){
|
||||
|
||||
//calls any logic in the fixed update state from current state
|
||||
currentState.FixedUpdateState(this);
|
||||
}
|
||||
|
||||
void SwitchState(MoveBaseState state){
|
||||
currentState = state;
|
||||
state.EnterState(this);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7adf74561e73e1c4e99ec7e3d6a08738
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e29a437006aa0374090c478aae4af886
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MoveIdleState : MoveBaseState
|
||||
{
|
||||
public override void EnterState(MoveStateManager mSM){
|
||||
|
||||
}
|
||||
|
||||
public override void UpdateState(MoveStateManager mSM){
|
||||
|
||||
}
|
||||
|
||||
public override void FixedUpdateState(MoveStateManager mSM){
|
||||
|
||||
}
|
||||
|
||||
public override void OnCollisionEnter(MoveStateManager mSM){
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 125078d4aa4c6df499f04e79c5142b5f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MoveJogState : MoveBaseState
|
||||
{
|
||||
public override void EnterState(MoveStateManager mSM){
|
||||
|
||||
}
|
||||
|
||||
public override void UpdateState(MoveStateManager mSM){
|
||||
|
||||
}
|
||||
|
||||
public override void FixedUpdateState(MoveStateManager mSM){
|
||||
|
||||
}
|
||||
|
||||
public override void OnCollisionEnter(MoveStateManager mSM){
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 51bfa6fd57184214195d51b209c92454
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MoveRunState : MoveBaseState
|
||||
{
|
||||
public override void EnterState(MoveStateManager mSM){
|
||||
|
||||
}
|
||||
|
||||
public override void UpdateState(MoveStateManager mSM){
|
||||
|
||||
}
|
||||
|
||||
public override void FixedUpdateState(MoveStateManager mSM){
|
||||
|
||||
}
|
||||
|
||||
public override void OnCollisionEnter(MoveStateManager mSM){
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 022dbadfec93fcf489a6e2bab39d0553
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,22 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MoveWalkState : MoveBaseState
|
||||
{
|
||||
public override void EnterState(MoveStateManager mSM){
|
||||
|
||||
}
|
||||
|
||||
public override void UpdateState(MoveStateManager mSM){
|
||||
|
||||
}
|
||||
|
||||
public override void FixedUpdateState(MoveStateManager mSM){
|
||||
|
||||
}
|
||||
|
||||
public override void OnCollisionEnter(MoveStateManager mSM){
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 44721a52e3dd5634bbd29b627ef2886b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user