改动与优化

This commit is contained in:
2026-07-20 22:19:25 +08:00
parent 0a0872c4f4
commit b5d1cdcbc5
83 changed files with 2475 additions and 276 deletions
+18 -4
View File
@@ -32,6 +32,7 @@ public class UI_userBag : MonoBehaviour
[Header("button")]
public Button closeBagButton;
private bool isClosing;
private void Awake()
{
@@ -43,6 +44,7 @@ public class UI_userBag : MonoBehaviour
private void OnEnable()
{
isClosing = false;
InitializeToggleGroup();
BindToggles();
BindCloseButton();
@@ -189,14 +191,21 @@ public class UI_userBag : MonoBehaviour
private void HandleCloseBagClicked()
{
uBag bagRoot = GetComponentInParent<uBag>();
if (bagRoot != null)
if (isClosing)
{
Destroy(bagRoot.gameObject);
return;
}
Destroy(gameObject);
isClosing = true;
uBag bagRoot = GetComponentInParent<uBag>();
GameObject target = bagRoot != null ? bagRoot.gameObject : gameObject;
UI_PanelExitUtility.PlayExitThen(target, () =>
{
if (target != null)
{
Destroy(target);
}
});
}
private void ApplyPanelState(GameObject activeObject)
@@ -221,7 +230,12 @@ public class UI_userBag : MonoBehaviour
return;
}
bool wasActive = target.activeInHierarchy;
target.SetActive(active);
if (active && !wasActive)
{
UI_OrderedEntryAnimator.PlayRefresh(target, 0.14f, -6f, 0.99f, true);
}
}
private void SetToggleInteractable(Toggle toggle, bool interactable)