48 lines
1.4 KiB
C#
48 lines
1.4 KiB
C#
|
|
using UnityEngine.UI;
|
||
|
|
using ZXKFramework;
|
||
|
|
public class FinishPanel : UIBase
|
||
|
|
{
|
||
|
|
public override string GroupName => UIGroupLiao.Init.ToString();
|
||
|
|
GameModel gameModel;
|
||
|
|
public override string Name => "FinishPanel";
|
||
|
|
Button detailsBtn;
|
||
|
|
public override void HandleEvent(string name, object data)
|
||
|
|
{
|
||
|
|
}
|
||
|
|
public override void Init(IUIManager uictrl)
|
||
|
|
{
|
||
|
|
base.Init(uictrl);
|
||
|
|
transform.FindFirst<Text>("ConfirmText").text = LanguageTools.Get(8);
|
||
|
|
transform.FindFirst<Button>("ConfirmButton").onClick.AddListener(() => {
|
||
|
|
Game.Instance.eventManager.Raise(new HomeEvent() { type = "Welcome" });
|
||
|
|
SetActive(false);
|
||
|
|
});
|
||
|
|
detailsBtn = transform.FindFirst<Button>("DetailsBtn");
|
||
|
|
detailsBtn.onClick.AddListener(() => {
|
||
|
|
uiManager.ShowUI<DetailsPanel>();
|
||
|
|
SetActive(false);
|
||
|
|
});
|
||
|
|
gameModel = GetModel<GameModel>();
|
||
|
|
}
|
||
|
|
public override void ShowData(params object[] obj)
|
||
|
|
{
|
||
|
|
base.ShowData(obj);
|
||
|
|
if (obj.Length != 0)
|
||
|
|
{
|
||
|
|
transform.FindFirst<Text>("Text").text = (string)obj[0];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
public override void Show()
|
||
|
|
{
|
||
|
|
base.Show();
|
||
|
|
if (gameModel.GetModeType() == ModeType.KaoHe)
|
||
|
|
{
|
||
|
|
detailsBtn.gameObject.SetActive(true);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
detailsBtn.gameObject.SetActive(false);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|