You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
995 B
C#

2 weeks ago
using System;
using TMPro;
using UnityEngine;
namespace Unity.BossRoom.Gameplay.UI
{
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()];
}
}
}
}