(client) feat:主要实现实体的行为树和工作类 (#40)

Co-authored-by: zzdxxz <2079238449@qq.com>
Co-committed-by: zzdxxz <2079238449@qq.com>
This commit is contained in:
2025-07-21 13:58:58 +08:00
committed by TheRedApricot
parent 389376ec47
commit 28ddcda9a0
87 changed files with 9052 additions and 2504 deletions

View File

@ -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)

View 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()
{
}
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 7eac7c56e1474c4ea646c0a408d293a3
timeCreated: 1752932683

View File

@ -0,0 +1,8 @@
namespace UI
{
public class PauseUI : UIBase
{
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: bcc7e9d015ee465684be520b65c2e182
timeCreated: 1752932641

View 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;
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 293a60af40144aafabdf65f49f5c6e44
timeCreated: 1752926575