add:添加对话等UI逻辑
parent
775ef42a74
commit
94c37c178c
|
@ -0,0 +1,7 @@
|
||||||
|
namespace ZC
|
||||||
|
{
|
||||||
|
[UIType(UIType.BasicInformationUI)]
|
||||||
|
public class BasicInformationUI : UIBase
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 74f502e15a4a4b7395115b6a9ffcad28
|
||||||
|
timeCreated: 1730991383
|
|
@ -0,0 +1,7 @@
|
||||||
|
namespace ZC
|
||||||
|
{
|
||||||
|
[UIType(UIType.BlackUI)]
|
||||||
|
public class BlackUI : UIBase
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: dd9abc3083384dc5a310404193297e5c
|
||||||
|
timeCreated: 1730991322
|
|
@ -0,0 +1,39 @@
|
||||||
|
using System;
|
||||||
|
using TMPro;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
namespace ZC
|
||||||
|
{
|
||||||
|
[UIType(UIType.DialogueUI)]
|
||||||
|
public class DialogueUI : UIBase
|
||||||
|
{
|
||||||
|
private TMP_Text txt_Title;
|
||||||
|
private TMP_Text txt_Content;
|
||||||
|
private Button btn_Close;
|
||||||
|
private Action callback;
|
||||||
|
|
||||||
|
public override void Init()
|
||||||
|
{
|
||||||
|
base.Init();
|
||||||
|
txt_Title = GetValue<TMP_Text>("txt_Title");
|
||||||
|
txt_Content = GetValue<TMP_Text>("txt_Content");
|
||||||
|
btn_Close = GetValue<Button>("btn_Close");
|
||||||
|
|
||||||
|
btn_Close.onClick.AddListener(ClickClose);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetData(string title, string content, Action callback = null)
|
||||||
|
{
|
||||||
|
txt_Title.text = title;
|
||||||
|
txt_Content.text = content;
|
||||||
|
this.callback = callback;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ClickClose()
|
||||||
|
{
|
||||||
|
ZCGame.UIManager.HideUI(UIType.DialogueUI);
|
||||||
|
callback?.Invoke();
|
||||||
|
callback = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 47c41230b1874478bbbe83c3db07af2d
|
||||||
|
timeCreated: 1730991374
|
Loading…
Reference in New Issue