您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
36 行
1.0 KiB
36 行
1.0 KiB
using TMPro;
|
|
using UnityEngine;
|
|
|
|
namespace Unity.Multiplayer.Samples.BossRoom.Client
|
|
{
|
|
public class QualityButton : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
TMP_Text m_QualityBtnText;
|
|
|
|
private void Start()
|
|
{
|
|
var index = QualitySettings.GetQualityLevel();
|
|
m_QualityBtnText.text = QualitySettings.names[index];
|
|
}
|
|
|
|
public void SetQualitySettings()
|
|
{
|
|
var qualityLevels = QualitySettings.names.Length - 1;
|
|
var currentLevel = QualitySettings.GetQualityLevel();
|
|
|
|
if (currentLevel < qualityLevels)
|
|
{
|
|
QualitySettings.IncreaseLevel();
|
|
m_QualityBtnText.text = QualitySettings.names[QualitySettings.GetQualityLevel()];
|
|
}
|
|
else
|
|
{
|
|
QualitySettings.SetQualityLevel(0);
|
|
m_QualityBtnText.text = QualitySettings.names[QualitySettings.GetQualityLevel()];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|