// Use this for initialization
 void Start()
 {
     this.idleTime  = 0;
     this.stateMenu = EStateMenu.MENU_START;
     this.panelMenuGame.SetActive(false);
     this.panelDificulty.SetActive(false);
     this.panelAboutGame.SetActive(false);
     this.panelController.SetActive(false);
 }
    public void BTHard()
    {
        this.stateMenu = EStateMenu.NONE;
        this.panelDificulty.SetActive(false);

        var listeners = FindObjectsOfType <MonoBehaviour> ().OfType <IGameStart> ();

        foreach (var listener in listeners)
        {
            listener.OnGameStart();
        }

        this.transitionMusic.Transition();
        GameController.instance.SetDifficulty(EDifficulty.HARD);
    }
    void Update()
    {
        switch (this.stateMenu)
        {
        case EStateMenu.NONE:

            break;

        case EStateMenu.MENU_START:
            this.panelStart.SetActive(true);

            if (IsTimeEnd())
            {
                SceneController.instance.Restart();
            }

            if (Input.GetButtonDown("Submit") || Input.touchCount > 0)
            {
                this.stateMenu = EStateMenu.MENU_GAME;
                this.panelStart.SetActive(false);
                this.idleTime = 0;
            }

            break;

        case EStateMenu.MENU_GAME:
            this.panelMenuGame.SetActive(true);
            if (Input.GetButtonDown("Cancel") || IsTimeEnd() || Input.touchCount > 2)
            {
                this.stateMenu = EStateMenu.MENU_START;
                this.panelMenuGame.SetActive(false);
                this.idleTime = 0;
            }

            break;

        case EStateMenu.DIFICULTY:
            this.panelDificulty.SetActive(true);
            if (Input.GetButtonDown("Cancel") || IsTimeEnd() || Input.touchCount > 2)
            {
                this.stateMenu = EStateMenu.MENU_GAME;
                this.panelDificulty.SetActive(false);
                this.idleTime = 0;
            }


            break;

        case EStateMenu.ABOUT_GAME:
            this.panelAboutGame.SetActive(true);
            if (Input.GetButtonDown("Cancel") || IsTimeEnd() || Input.touchCount > 2)
            {
                this.stateMenu = EStateMenu.MENU_GAME;
                this.panelAboutGame.SetActive(false);
                this.idleTime = 0;
            }


            break;

        case EStateMenu.CONTROLLER:
            this.panelController.SetActive(true);
            if (Input.GetButtonDown("Cancel") || IsTimeEnd() || Input.touchCount > 2)
            {
                this.stateMenu = EStateMenu.MENU_GAME;
                this.panelController.SetActive(false);
                this.idleTime = 0;
            }


            break;
        }
    }
 public void BTController()
 {
     this.idleTime  = 0;
     this.stateMenu = EStateMenu.CONTROLLER;
     this.panelMenuGame.SetActive(false);
 }
 public void BTAboutGame()
 {
     this.idleTime  = 0;
     this.stateMenu = EStateMenu.ABOUT_GAME;
     this.panelMenuGame.SetActive(false);
 }
 public void BTNewGame()
 {
     this.idleTime  = 0;
     this.stateMenu = EStateMenu.DIFICULTY;
     this.panelMenuGame.SetActive(false);
 }