postprocessing options (1)
This commit is contained in:
Executable file → Normal file
+12
-1
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user