public static GoToNewRegionOgreState GetInstance() { if (instance == null) { instance = new GoToNewRegionOgreState(); } return(instance); }
public override void FixedUpdate(Ogre owner) { base.FixedUpdate(owner); if (owner.GetCurrentRegion != null) { if (owner.GetCurrentRegion.resourceCount <= 0) { owner.GetFSM.ChangeState(GoToNewRegionOgreState.GetInstance()); } } }
// Initialize state in Start (Called after all objects are Awake) private void Start() { stateMachine.SetGlobalState(GlobalOgreState.GetInstance()); stateMachine.ChangeState(GoToNewRegionOgreState.GetInstance()); }