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
Executable file → Normal file
+12 -1
View File
@@ -1,7 +1,6 @@
using TMPro;
using UnityEngine;
using System.Collections.Generic;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;
public class SettingsPanel : MonoBehaviour
@@ -11,6 +10,8 @@ public class SettingsPanel : MonoBehaviour
public bool DisableSettingsPanelWhenLinkedGameobjectIsActivated = false;
public TMP_Dropdown GraphicsQualityDropdown;
public PostProcessVolume PostProcessVolume;
public List<PostProcessVolume> PostProcessingVolumes = new() { };
private void Update()
{
if (settingsPanel && DisableSettingsPanelWhenLinkedGameobjectIsActivated && settingsPanelDeactivator.activeInHierarchy)
@@ -20,6 +21,16 @@ public class SettingsPanel : MonoBehaviour
}
}
public void AcTogglePostProcessing(bool IsEnabled) {
if (IsEnabled)
PlayerPrefs.SetInt("PostProcessingEnabled", 1);
else
PlayerPrefs.SetInt("PostProcessingEnabled", 0);
foreach (PostProcessVolume volume in PostProcessingVolumes)
volume.enabled = IsEnabled;
}
private void Start()
{
if (GraphicsQualityDropdown)