init commit
This commit is contained in:
23
Assets/Others/TestUI.cs
Normal file
23
Assets/Others/TestUI.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class TestUI : MonoBehaviour
|
||||
{
|
||||
public TMP_Dropdown QualityDropdown;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
InitDropdown();
|
||||
}
|
||||
|
||||
private void InitDropdown()
|
||||
{
|
||||
QualityDropdown.ClearOptions();
|
||||
QualityDropdown.AddOptions(QualitySettings.names.ToList());
|
||||
QualityDropdown.value = QualitySettings.GetQualityLevel();
|
||||
QualityDropdown.onValueChanged.AddListener(index => QualitySettings.SetQualityLevel(index));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user