コード例 #1
0
ファイル: MainMenuView.cs プロジェクト: UnVoiding/TicTacToe
    // Update is called once per frame
    void Update()
    {
        var a         = GetComponent <Animator>();
        var stateInfo = a.GetCurrentAnimatorStateInfo(0);
        var animTime  = stateInfo.normalizedTime;

        if (animTime > 0.75f && !a.IsInTransition(0))
        {
            if (stateInfo.IsName("MainMenuGoToPlay"))
            {
                TicTacToeGlobal.views.chooseMapView.SetActive(true);
            }
            else if (stateInfo.IsName("MainMenuGoToDesign"))
            {
                TicTacToeGlobal.views.ActivateDesignView();
            }
            else if (stateInfo.IsName("MainMenuGoToSettings"))
            {
                TicTacToeGlobal.views.ActivateSettingsView();
            }
        }

        if (animTime > 1.0f && !a.IsInTransition(0))
        {
            if (stateInfo.IsName("MainMenuQuit"))
            {
                ApplicationUtil.Quit();
            }
        }

        if (animTime > 1.75f && !a.IsInTransition(0))
        {
            if (stateInfo.IsName("MainMenuGoToPlay") ||
                stateInfo.IsName("MainMenuGoToDesign") ||
                stateInfo.IsName("MainMenuGoToSettings"))
            {
                TicTacToeGlobal.views.mainMenuView.SetActive(false);
            }
        }
    }
コード例 #2
0
 public void Exit()
 {
     ApplicationUtil.Quit();
 }