void OnQualityLevelChanged()
 {
     GetComponent <Camera>().renderingPath =
         GameBuilderApplication.GetQuality() == GameBuilderApplication.Quality.Low
   ? RenderingPath.Forward
   : RenderingPath.DeferredShading;
 }
Ejemplo n.º 2
0
 public void LoadMainSceneAsync(GameBuilderApplication.GameOptions gameOptions = new GameBuilderApplication.GameOptions())
 {
     bsod?.NotifySceneClosing();
     GameBuilderApplication.Get().SetGameOptionsDoNotUseExceptFromSceneController(gameOptions);
     OnBeforeReloadMainScene?.Invoke();
     LastLoadStart = Time.realtimeSinceStartup;
     SceneManager.LoadSceneAsync("main", LoadSceneMode.Single);
 }
Ejemplo n.º 3
0
 public static GameBuilderApplication Get()
 {
     if (Instance == null)
     {
         Instance = new GameBuilderApplication();
     }
     return(Instance);
 }
Ejemplo n.º 4
0
 private void UpdateQualitySetting(int index)
 {
     if (QualitySettings.GetQualityLevel() == index)
     {
         return;
     }
     QualitySettings.SetQualityLevel(index);
     GameBuilderApplication.NotifyQualityLevelChanged();
 }
Ejemplo n.º 5
0
 public void ToggleFullscreen()
 {
     if (Screen.fullScreenMode == FullScreenMode.Windowed)
     {
         // Always try for exclusive - it's A LOT faster on laptops.
         Screen.fullScreenMode = FullScreenMode.ExclusiveFullScreen;
     }
     else
     {
         Screen.fullScreenMode = FullScreenMode.Windowed;
     }
     GameBuilderApplication.SaveDisplaySettings();
 }
Ejemplo n.º 6
0
 public BenchmarkState(string note)
 {
     this.startTimestamp    = System.DateTime.Now.ToString();
     this.note              = note;
     this.builtCommit       = GameBuilderApplication.ReadBuildCommit();
     this.host              = System.Net.Dns.GetHostName();
     this.screenWidth       = Screen.width;
     this.screenHeight      = Screen.height;
     this.fullscreenMode    = Screen.fullScreenMode.ToString();
     this.qualityLevel      = QualitySettings.GetQualityLevel();
     this.terrainMips       = TerrainSystem.UseMips;
     this.actorMemCheckMode = VoosEngine.MemCheckMode;
     this.cpuInfo           = SystemInfo.processorType;
     this.gpuInfo           = SystemInfo.graphicsDeviceName;
 }
    void Awake()
    {
        Util.UpgradeUserDataDir();

        Util.FindIfNotSet(this, ref scenes);
        Util.FindIfNotSet(this, ref library);
        Util.FindIfNotSet(this, ref resuming);
        Util.FindIfNotSet(this, ref popups);
        Util.FindIfNotSet(this, ref loadingScreen);
        Util.FindIfNotSet(this, ref sceneController);

#if USE_STEAMWORKS
        foreach (GameFeatured featured in featuredGames)
        {
            featured.Setup();
        }
#endif

        newButton.onClick.AddListener(templateSelectorMenu.Show);
        creditsButton.onClick.AddListener(() => creditsObject.SetActive(true));
        creditsCloseButton.onClick.AddListener(() => creditsObject.SetActive(false));
        gameLibraryButton.onClick.AddListener(menuPanelManager.OpenGameLibrary);
        menuPanelManager.Setup();
        quitButton.onClick.AddListener(Application.Quit);

#if USE_PUN
        multiplayerButton.onClick.AddListener(menuPanelManager.OpenMultiplayerMenu);
#else
        multiplayerButton.gameObject.SetActive(false);
#endif

        moreGamesButton.onClick.AddListener(MoreGames);

        // featuredMessage.text = FEATURED_LOADING;
        featuredMessage.text = FEATURED_MSG;

        menuPanelManager.SetLibraryHeaderText(LIBRARY_HEADER);
        templateSelectorMenu.Setup();

        // To help diagnose things
        Util.Log($"Culture info: {System.Threading.Thread.CurrentThread.CurrentCulture}");
        Util.Log($"GB build commit: {GameBuilderApplication.ReadBuildCommit()}");
    }
Ejemplo n.º 8
0
    void OnQualityLevelChanged()
    {
        CheckHQL();
        CheckLQL();
        CheckPost();
        CheckPostProfile();

        var quality = GameBuilderApplication.GetQuality();

        if (quality == GameBuilderApplication.Quality.High)
        {
            HighQualityLighting.SetActive(true);
            LowQualityLighting.SetActive(false);
            post.enabled = true;
            post.profile.GetSetting <URP.MotionBlur>().enabled.value       = true;
            post.profile.GetSetting <URP.AmbientOcclusion>().enabled.value = true;
        }
        else if (quality == GameBuilderApplication.Quality.Medium)
        {
            // Still want shadows for med, but their distance is reduced.
            HighQualityLighting.SetActive(true);
            LowQualityLighting.SetActive(false);
            post.enabled = true;
            post.profile.GetSetting <URP.MotionBlur>().enabled.value       = false;
            post.profile.GetSetting <URP.AmbientOcclusion>().enabled.value = false;
        }
        else
        {
            Debug.Assert(quality == GameBuilderApplication.Quality.Low, $"Expected Low quality. Got: {quality.ToString()}");

            HighQualityLighting.SetActive(false);
            LowQualityLighting.SetActive(true);

            // NO POST!
            post.enabled = false;
        }
    }
Ejemplo n.º 9
0
 private void UpdateResolution(Resolution resolution)
 {
     Screen.SetResolution(resolution.width, resolution.height, Screen.fullScreenMode, resolution.refreshRate);
     GameBuilderApplication.SaveDisplaySettings();
 }