50 lines
1.1 KiB
C#
50 lines
1.1 KiB
C#
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class VRAntialiasingDropdown : MonoBehaviour
|
|
{
|
|
private Dropdown dropdown;
|
|
|
|
private RenderSettingsMy renderSettings;
|
|
|
|
private void Start()
|
|
{
|
|
InitList();
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
InitList();
|
|
}
|
|
|
|
private void InitList()
|
|
{
|
|
if ((bool)GlobalSettings.Instance && (bool)GlobalSettings.Instance.renderSettings)
|
|
{
|
|
renderSettings = GlobalSettings.Instance.renderSettings;
|
|
dropdown = base.gameObject.GetComponent<Dropdown>();
|
|
dropdown.options.Clear();
|
|
dropdown.options.Capacity = 0;
|
|
dropdown.options.Add(new Dropdown.OptionData(Utilities.GetTranslation("GUI/NONE")));
|
|
dropdown.options.Add(new Dropdown.OptionData("FXAA"));
|
|
dropdown.options.Add(new Dropdown.OptionData("TAA"));
|
|
dropdown.value = (int)renderSettings.currentAntialiasing;
|
|
dropdown.RefreshShownValue();
|
|
}
|
|
}
|
|
|
|
public void UpdateQuality()
|
|
{
|
|
if ((bool)renderSettings)
|
|
{
|
|
renderSettings.currentAntialiasing = (RenderSettingsMy.Antialiasing)dropdown.value;
|
|
renderSettings.Save();
|
|
}
|
|
}
|
|
|
|
public void LanguageChanged()
|
|
{
|
|
InitList();
|
|
}
|
|
}
|