Esempio n. 1
0
        public void ChangeState(int state, object[] extraArgs)
        {
            if (CurrentState == state)
            {
                return;
            }

            CurrentState = state;

            if (StateHandler != null)
            {
                StateHandler.Dispose();
                StateHandler = null;
            }

            StateHandler = StateFactory.Create(state, extraArgs);
            StateHandler.Initialize();
        }
Esempio n. 2
0
 // Use this for initialization
 void Start()
 {
     stateInstance = Instantiate(stateHandler) as StateHandler;
     stateHandler.Initialize(Exit);
 }