Init repository
This commit is contained in:
Executable file
+47
@@ -0,0 +1,47 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.PostProcessing;
|
||||
|
||||
public class SettingsPanel : MonoBehaviour
|
||||
{
|
||||
public GameObject settingsPanel;
|
||||
public GameObject settingsPanelDeactivator;
|
||||
public bool DisableSettingsPanelWhenLinkedGameobjectIsActivated = false;
|
||||
public TMP_Dropdown GraphicsQualityDropdown;
|
||||
public PostProcessVolume PostProcessVolume;
|
||||
private void Update()
|
||||
{
|
||||
if (settingsPanel && DisableSettingsPanelWhenLinkedGameobjectIsActivated && settingsPanelDeactivator.activeInHierarchy)
|
||||
{
|
||||
settingsPanel.SetActive(false);
|
||||
settingsPanelDeactivator.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
if (GraphicsQualityDropdown)
|
||||
{
|
||||
string[] QualityNames = QualitySettings.names;
|
||||
List<TMP_Dropdown.OptionData> Options = new();
|
||||
GraphicsQualityDropdown.ClearOptions();
|
||||
foreach (string QualityName in QualityNames)
|
||||
{
|
||||
Options.Add(new TMP_Dropdown.OptionData(QualityName));
|
||||
}
|
||||
|
||||
GraphicsQualityDropdown.AddOptions(Options);
|
||||
GraphicsQualityDropdown.value = QualitySettings.GetQualityLevel();
|
||||
}
|
||||
}
|
||||
|
||||
public void SwitchQualitySettings(int index)
|
||||
{
|
||||
if (GraphicsQualityDropdown)
|
||||
{
|
||||
QualitySettings.SetQualityLevel(index);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user