Files
JJBB/Assets/Project/Script/GUI/GraphicsNotice/GraphicsNoticeLogic.cs

78 lines
2.7 KiB
C#
Raw Normal View History

2024-08-23 15:49:34 +08:00
//using Games.GlobeDefine;
//using GCGame.Table;
//using UnityEngine;
//using UnityEngine.UI;
//public class GraphicsNoticeLogic : MonoBehaviour
//{
// private Button _cancelButton;
// private Button _confirmButton;
// private int _currentIndex;
// private Text _description;
// private Button[] _options;
// private RectTransform _select;
// public static int targetQualityLevel { get; set; }
// private void Awake()
// {
// var panel = transform.Find("Panel");
// _description = panel.Find("Description").GetComponent<Text>();
// _options = new Button[PlayerPreferenceData.qualityStandards.Length];
// for (var i = 0; i < PlayerPreferenceData.qualityStandards.Length; i++)
// {
// _options[i] = panel.Find("Option_" + i).GetComponent<Button>();
// // 勿改否则delegate会使用循环结束的i数值
// var index = i;
// _options[i].onClick.AddListener(() => OnSelectOption(index));
// }
// _select = (RectTransform) panel.Find("Select");
// _confirmButton = panel.Find("ConfirmButton").GetComponent<Button>();
// _cancelButton = panel.Find("CancelButton").GetComponent<Button>();
// _confirmButton.onClick.AddListener(OnConfirm);
// _cancelButton.onClick.AddListener(OnCancel);
// }
// private void Start()
// {
// _currentIndex = targetQualityLevel;
// int strIndex;
// switch (_currentIndex)
// {
// case 0:
// strIndex = 4939;
// break;
// case 1:
// strIndex = 4938;
// break;
// default:
// strIndex = 4937;
// break;
// }
// var strDict = TableManager.GetStrDictionaryByID(strIndex, 0);
// var description = strDict == null ? string.Empty : strDict.StrDictionary;
// _description.text = description;
// OnSelectOption(_currentIndex);
// }
// private void OnConfirm()
// {
// if (_currentIndex >= 0 && _currentIndex < PlayerPreferenceData.qualityStandards.Length)
// PlayerPreferenceData.qualityStandards[_currentIndex].ApplyToCurrent();
// // 声音由OnCancel播放
// OnCancel();
// }
// private void OnCancel()
// {
// GameManager.gameManager.SoundManager.PlaySoundEffect(GlobeVar.defaultButtonSound);
// UIManager.CloseUI(UIInfo.GraphicsNotice);
// }
// private void OnSelectOption(int index)
// {
// _currentIndex = index;
// _select.anchoredPosition = _options[_currentIndex].image.rectTransform.anchoredPosition;
// GameManager.gameManager.SoundManager.PlaySoundEffect(GlobeVar.defaultButtonSound);
// }
//}