改动与优化
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user