static void Main(string[] args) { IGraphicUserInterface gui = new ConsoleUserInterface(); MenuStateMachine menu = new MenuStateMachine(gui); menu.Start(); }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { menuStateMachine = animator.gameObject.GetComponent <MenuStateMachine>(); if (menuStateMachine == null) { Debug.LogError("MenuStateMachine Does Not Exist"); } else { menuStateMachine.RefreshStateMachine((int)menuName); } }
void Start() { m_msm = GetComponent <MenuStateMachine>(); m_msm.AddState(LEVEL_SELECT, new LevelSelect()); m_msm.AddState(MODE_SELECT, new GameModeSelect()); m_msm.AddState(CHAR_SELECT, new CharacterSelect()); m_msm.ChangeToState(MODE_SELECT); characterPrefabs = new List <GameObject>(gm.allCharacterPrefabs); currentES = GameObject.FindObjectOfType <EventSystem>(); currentES.SetSelectedGameObject(startButton.gameObject); currentButton = startButton; selectBar = currentButton.transform.Find("SelectBar").gameObject; }
public void Update() { //if (MenuStateMachine.GetInstanceMenuStateMachine() != null) //{ // if (MenuStateMachine.GetInstanceMenuStateMachine().State == MenuState.Exit) // { // if (m_isVisible) // IsVisible(true); // else // IsVisible(false); // } // else // { // IsVisible(false); // } //} //else //{ //IsVisible(m_isVisible); // } if (MenuStateMachine.GetInstanceMenuStateMachine() != null) { if (!MenuStateMachine.GetInstanceMenuStateMachine().isFirstEnterCLose) { IsVisible(false); } else { IsVisible(m_isVisible); } } else { IsVisible(m_isVisible); } }
void Awake() { instance = this; }