(client) chore:Clean code
This commit is contained in:
@ -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 调用,这里再次确保同步是合理的。
|
||||
|
Reference in New Issue
Block a user