void Start() { _rigid = GetComponent<Rigidbody> (); _moGround.Startup (this); _moInAir.Startup (this); _moAttached.Startup (this); _moStasis.Startup (this); _moAnim.Startup (this); _camera = cameraTrans.GetComponent<Camera_Controller> (); _move = _moGround; _move.EnterState (); GetMeshes (); }
//this is the housing for all motion controls //they are broken into different motion classes that are switched to based on conditions. public void NowInAir() { if(_move.CurrentState != _moStasis.CurrentState){ _move.ExitState (); } _move = _moInAir; _move.EnterState (); }
public void NowStasis() { _move.ExitState (); _move = _moStasis; _move.EnterState (); }
public void NowGrounded() { if(_move.CurrentState != _moStasis.CurrentState){ _move.ExitState (); } _move = _moGround; _move.EnterState (); }