(client) feat:添加设置类,子弹添加敌我识别; chore:修改了右键菜单的初始化方式为独立创建,加载定义报错提供更多信息,动画加载出错也返回默认序列。

This commit is contained in:
m0_75251201
2025-08-19 14:36:22 +08:00
parent f67aca0804
commit f4cd5f4a86
57 changed files with 1000 additions and 788 deletions

View File

@ -17,7 +17,7 @@ namespace Prefab
public void Hide()
{
gameObject.SetActive(false);
Destroy(this.gameObject);
}
public void Init(List<(string name, UnityAction callback)> buttons)
@ -27,8 +27,6 @@ namespace Prefab
Debug.LogError("Menu or ButtonPrefab is not assigned!");
return;
}
ClearMenu();
foreach (var (label, callback) in buttons)
{
// 实例化按钮预制体
@ -68,14 +66,6 @@ namespace Prefab
}
}
}
public void ClearMenu()
{
// 遍历菜单下的所有子对象并销毁它们
foreach (Transform child in menu.transform)
{
Destroy(child.gameObject);
}
}
public void OnPointerExit(PointerEventData eventData)
{
Hide();