52 lines
1.0 KiB
C#
52 lines
1.0 KiB
C#
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
|
|
public override void OnInit()
|
|
{
|
|
//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 OnOpenWindow(object data = null)
|
|
{
|
|
if (data != null)
|
|
{
|
|
Text_Update.text = string.Format("请更新客户端版本:{0}", data);
|
|
Text_Yes.text = "Exit";
|
|
}
|
|
}
|
|
|
|
//invoke when reload window
|
|
protected override void OnReloadWindow(object data = null)
|
|
{
|
|
|
|
}
|
|
|
|
} |