NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/UI/UI_UpdateController.cs

52 lines
1.0 KiB
C#
Raw Normal View History

2023-11-20 16:47:49 +08:00
using TMPro;
using UnityEngine;
using Button = UnityEngine.UI.Button;
using Image = UnityEngine.UI.Image;
public class UI_UpdateController : UIWindow
{
//UI GameObj
///Auto Gen Start///
public Image Image_NoticeBG;
public TMP_Text Text_Update;
public Button Button_Yes;
public TMP_Text Text_Yes;
///Auto Gen End///
// Use this for initialization
2024-01-23 12:25:47 +08:00
public override void OnInit()
2023-11-20 16:47:49 +08:00
{
//bind UI GameObj
UI_UpdateBinder.GetComponents(this);
string text = Text_Update.text;
Text_Update.text = string.Format(text, Application.version);
BindButton(Button_Yes, ExitGame);
}
private void ExitGame()
{
Application.Quit();
#if UNITY_EDITOR
UnityEditor.EditorApplication.isPlaying = false;
#endif
}
//invoke when open window
protected override void OnShowWindow(object data = null)
2023-11-20 16:47:49 +08:00
{
2023-11-20 18:46:43 +08:00
if (data != null)
{
Text_Update.text = string.Format("请更新客户端版本:{0}", data);
Text_Yes.text = "Exit";
}
2023-11-20 16:47:49 +08:00
}
//invoke when reload window
protected override void OnReloadWindow(object data = null)
{
}
2023-11-21 13:34:26 +08:00
2023-11-20 16:47:49 +08:00
}