コード例 #1
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.F8) && Input.GetKey(KeyCode.LeftControl))
        {
            PerfBenchmark.CommandBenchmark(null);
        }

#if UNITY_EDITOR
        if (Input.GetKeyDown(KeyCode.F9) && Input.GetKey(KeyCode.LeftControl))
        {
            var gameOpts = new GameBuilderApplication.GameOptions
            {
                playOptions = new GameBuilderApplication.PlayOptions
                {
                    isMultiplayer    = true,
                    startAsPublic    = false,
                    startInBuildMode = true
                }
            };
            string path = System.IO.Path.Combine(Application.streamingAssetsPath, "ExampleGames", "Internal", "template-small.voos");
            loadingScreen.ShowAndDo(() => sceneController.RestartAndLoad(path, gameOpts));
        }
#endif

#if UNITY_EDITOR
        if (Input.GetKeyDown(KeyCode.F10) && Input.GetKey(KeyCode.LeftControl))
        {
            sceneController.JoinMultiplayerGameByCode($"1-dev-{System.Net.Dns.GetHostName().ToLowerInvariant()}");
        }
#endif

        if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.N))
        {
            sceneController.RestartAndLoadMinimalScene(new GameBuilderApplication.GameOptions());
        }

        if (Input.GetButtonDown("Cancel"))
        {
            if (creditsObject.activeSelf)
            {
                creditsObject.SetActive(false);
            }
            else if (templateSelectorMenu.IsOpen())
            {
                templateSelectorMenu.Close();
            }
            else
            {
                menuPanelManager.Back();
            }
        }

        AudioListener.volume = Application.isFocused ? 1 : 0;
    }
コード例 #2
0
 void LaunchNew()
 {
     sceneController.RestartAndLoadMinimalScene();
 }