(client) feat:主要实现实体的行为树和工作类 (#40)
Co-authored-by: zzdxxz <2079238449@qq.com> Co-committed-by: zzdxxz <2079238449@qq.com>
This commit is contained in:
@ -5,13 +5,13 @@ using UnityEngine.UI;
|
||||
|
||||
namespace UI
|
||||
{
|
||||
public class DevMenuUI : MonoBehaviour
|
||||
public class DevMenuUI : UIBase
|
||||
{
|
||||
public GameObject menuContent;
|
||||
|
||||
public Prefab.TextPrefab textTemplate;
|
||||
public Prefab.ButtonPrefab buttonTemplate;
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
Init();
|
||||
@ -19,10 +19,12 @@ namespace UI
|
||||
|
||||
void Init()
|
||||
{
|
||||
Managers.DefineManager.Instance.Init();
|
||||
InitEvent();
|
||||
InitCharacter();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void InitEvent()
|
||||
{
|
||||
var title = InstantiatePrefab(textTemplate, menuContent.transform);
|
||||
@ -32,12 +34,13 @@ namespace UI
|
||||
// var button= InstantiatePrefab(buttonTemplate, menuContent.transform);
|
||||
// button.text.text = i.ToString();
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
void InitCharacter()
|
||||
{
|
||||
var title = InstantiatePrefab(textTemplate, menuContent.transform);
|
||||
title.Label = "点击切换人物";
|
||||
title.Label = "生成人物";
|
||||
|
||||
var defList = Managers.DefineManager.Instance.QueryNamedDefinesByType<Data.CharacterDef>();
|
||||
foreach (var def in defList)
|
||||
|
24
Client/Assets/Scripts/UI/EscUI.cs
Normal file
24
Client/Assets/Scripts/UI/EscUI.cs
Normal file
@ -0,0 +1,24 @@
|
||||
namespace UI
|
||||
{
|
||||
public class EscUI:UIBase
|
||||
{
|
||||
public void ContinueButton()
|
||||
{
|
||||
Base.UIInputControl.Instance.CloseWindow(this);
|
||||
}
|
||||
|
||||
public void ExitButton()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
UnityEditor.EditorApplication.isPlaying = false; // 停止编辑器播放模式
|
||||
#else
|
||||
Application.Quit(); // 关闭游戏
|
||||
#endif
|
||||
}
|
||||
|
||||
public void SettingsButton()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/UI/EscUI.cs.meta
Normal file
3
Client/Assets/Scripts/UI/EscUI.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7eac7c56e1474c4ea646c0a408d293a3
|
||||
timeCreated: 1752932683
|
8
Client/Assets/Scripts/UI/PauseUI.cs
Normal file
8
Client/Assets/Scripts/UI/PauseUI.cs
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
namespace UI
|
||||
{
|
||||
public class PauseUI : UIBase
|
||||
{
|
||||
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/UI/PauseUI.cs.meta
Normal file
3
Client/Assets/Scripts/UI/PauseUI.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bcc7e9d015ee465684be520b65c2e182
|
||||
timeCreated: 1752932641
|
15
Client/Assets/Scripts/UI/UIBase.cs
Normal file
15
Client/Assets/Scripts/UI/UIBase.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace UI
|
||||
{
|
||||
public abstract class UIBase:MonoBehaviour
|
||||
{
|
||||
public KeyCode actionButton = KeyCode.None;
|
||||
// 显示或隐藏窗口
|
||||
public virtual void Show() { gameObject.SetActive(true); }
|
||||
public virtual void Hide() { gameObject.SetActive(false); }
|
||||
|
||||
// 判断是否可见
|
||||
public bool IsVisible => gameObject.activeInHierarchy;
|
||||
}
|
||||
}
|
3
Client/Assets/Scripts/UI/UIBase.cs.meta
Normal file
3
Client/Assets/Scripts/UI/UIBase.cs.meta
Normal file
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 293a60af40144aafabdf65f49f5c6e44
|
||||
timeCreated: 1752926575
|
Reference in New Issue
Block a user