postprocessing options (1)

This commit is contained in:
mangorifo
2024-01-31 22:53:00 +08:00
parent 64fbc0031a
commit 2951c4d538
310 changed files with 2144 additions and 143 deletions
+29 -14
View File
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.Rendering.PostProcessing;
using UnityEngine.UI;
public class HomeWorld_Initialize : MonoBehaviour
@@ -28,6 +28,9 @@ public class HomeWorld_Initialize : MonoBehaviour
public RectTransform SettingsPanel;
private Resolution GameResolutionPre;
public Toggle FullscreenToggle;
public Toggle PostProcessingToggle;
public SettingsPanel SettingsPanelScript;
private async void Start()
{
@@ -42,19 +45,19 @@ public class HomeWorld_Initialize : MonoBehaviour
OpenMenuClip1 = await JTN.Utils.LoadClip(Path.Combine(Application.streamingAssetsPath, StartingClipName));
if (audioSource && OpenMenuClip1)
audioSource.PlayOneShot(OpenMenuClip1, PlayVolume);
/* if (SettingsPanel)
{
if (Screen.currentResolution.height != GameResolutionPre.height)
{
SettingsPanel.sizeDelta = new Vector2(SettingsPanel.sizeDelta.x, Screen.currentResolution.height);
GameResolutionPre = Screen.currentResolution;
}
if (Screen.currentResolution.width != GameResolutionPre.width)
{
SettingsPanel.sizeDelta = new Vector2(Screen.currentResolution.width, SettingsPanel.sizeDelta.y);
GameResolutionPre = Screen.currentResolution;
}
}*/
/* if (SettingsPanel)
{
if (Screen.currentResolution.height != GameResolutionPre.height)
{
SettingsPanel.sizeDelta = new Vector2(SettingsPanel.sizeDelta.x, Screen.currentResolution.height);
GameResolutionPre = Screen.currentResolution;
}
if (Screen.currentResolution.width != GameResolutionPre.width)
{
SettingsPanel.sizeDelta = new Vector2(Screen.currentResolution.width, SettingsPanel.sizeDelta.y);
GameResolutionPre = Screen.currentResolution;
}
}*/
if (PlayerPrefs.HasKey("FullscreenState") && FullscreenToggle)
{
@@ -66,6 +69,18 @@ public class HomeWorld_Initialize : MonoBehaviour
FullscreenToggle.isOn = false;
}
}
if (PlayerPrefs.GetInt("PostProcessingEnabled") == 1)
{
foreach (PostProcessVolume volume in SettingsPanelScript.PostProcessingVolumes)
volume.enabled = true;
PostProcessingToggle.isOn = true;
} else
{
foreach (PostProcessVolume volume in SettingsPanelScript.PostProcessingVolumes)
volume.enabled = false;
PostProcessingToggle.isOn = false;
}
}
private void FixedUpdate()