示例#1
0
    void Update()
    {
        if (fadePushButton)
        {
            PushButton.Draw();
            //ボタンを押してメニュー表示
            if (!ReturnOp && KeyLoader.keyLoader.IsAnyKey())
            {
                backcnt        = 0;
                fadePushButton = false;
                gui.SetActive(true);
                menuUI.gameObject.SetActive(true);
                //再度表示する時のために初期化
                PushButton.Reset();
                PushButton.gameObject.SetActive(false);
                //決定音
                SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Decide));
            }
            else
            {
                ReturnOpeningScene();
            }
        }
        else
        {
            menuUI.Draw(menu);
            if (menuSelect && KeyLoader.keyLoader.joyStickAxis.x > 0 && !KeyLoader.keyLoader.StickWait)
            {
                menu++;
                if (menu > Menu.END)
                {
                    menu = Menu.START;
                }
                SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move));
                KeyLoader.keyLoader.SetStickWait(ResetFrame);
            }
            else if (menuSelect && KeyLoader.keyLoader.joyStickAxis.x < 0 && !KeyLoader.keyLoader.StickWait)
            {
                menu--;
                if (menu < Menu.START)
                {
                    menu = Menu.END;
                }
                SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Move));
                KeyLoader.keyLoader.SetStickWait(ResetFrame);
            }
            if (menuSelect && KeyLoader.keyLoader.B)
            {
                SEMaster.Play(KeyInputSE.keyInoutSE.GetClip(KeyInputSE.Type.Cancel));
                gui.SetActive(false);
                fadePushButton = true;
                PushButton.gameObject.SetActive(true);
                menuUI.gameObject.SetActive(false);
            }

            switch (menu)
            {
            case Menu.START:
                GameStart();
                break;

            case Menu.CONFIG:
                GameConfig();
                break;

            case Menu.CREDIT:
                GameCredit();
                break;

            case Menu.END:
                GameEnd();
                break;
            }
        }
    }