// Use this for initialization void Start () { #region applicationStateMachine //create the application state machine appliStateMachine = new ApplicationStateMachine(); //register all of the states appliStateMachine.registerState(Enum_AppliStateKey.MenuCredit, new MenuCreditState()); appliStateMachine.registerState(Enum_AppliStateKey.Game, new GameState()); appliStateMachine.registerState(Enum_AppliStateKey.MenuMain, new MenuMainState()); //initialize the current state appliStateMachine.initCurrentState(Enum_AppliStateKey.MenuMain); audioSource = gameObject.GetComponent<AudioSource>(); audioSource.clip = audioclip; #endregion applicationStateMachine }
private void Awake() { applicationStateMachine = new ApplicationStateMachine(); new GameStateMachine(); }