(client) chore:Clean code

This commit is contained in:
2025-08-28 16:20:24 +08:00
parent 909e995e15
commit c3bff1cf88
76 changed files with 5689 additions and 445 deletions

View File

@ -1,6 +1,6 @@
using System.Collections.Generic;
using Base;
using Entity;
using System.Collections.Generic;
using UnityEngine;
// 确保 Character 类在此命名空间下
@ -103,7 +103,7 @@ namespace UI
// 立即更新UI以反映新的关注实体或没有关注实体的状态。
UpdateUI();
// 在更新UI后确保UI的选中状态与角色当前选中字段同步
// 只有当有焦点角色且库存不为空时才更新选中状态
if (focusedEntity != null && focusedEntity.Inventory != null && focusedEntity.Inventory.Capacity > 0)
@ -187,7 +187,7 @@ namespace UI
}
}
uiParent.SetActive(true);
// 首次更新UI时或者当Inventory改变时需要确保 CurrentSelected 的UI状态是正确的
// 但如果 UpdateFocusedEntity 已经处理了,这里可以省略,或者确保只在必要时调用
// 考虑到 UpdateUI 也会被 Inventory.OnInventoryChanged 调用,这里再次确保同步是合理的。