UI HUGE UPDATE
This commit is contained in:
@@ -37,6 +37,7 @@ public class UI_userBag : MonoBehaviour
|
||||
{
|
||||
InitializeToggleGroup();
|
||||
BindToggles();
|
||||
BindCloseButton();
|
||||
SelectDefaultPanel();
|
||||
}
|
||||
|
||||
@@ -44,6 +45,7 @@ public class UI_userBag : MonoBehaviour
|
||||
{
|
||||
InitializeToggleGroup();
|
||||
BindToggles();
|
||||
BindCloseButton();
|
||||
SelectDefaultPanel();
|
||||
}
|
||||
|
||||
@@ -54,6 +56,7 @@ public class UI_userBag : MonoBehaviour
|
||||
UnbindToggle(equipIllusion, HandleEquipIllusionChanged);
|
||||
UnbindToggle(equipAttributeTransfer, HandleEquipAttributeTransferChanged);
|
||||
UnbindToggle(equipAwake, HandleEquipAwakeChanged);
|
||||
UnbindCloseButton();
|
||||
}
|
||||
|
||||
private void InitializeToggleGroup()
|
||||
@@ -111,6 +114,27 @@ public class UI_userBag : MonoBehaviour
|
||||
toggle.onValueChanged.RemoveListener(action);
|
||||
}
|
||||
|
||||
private void BindCloseButton()
|
||||
{
|
||||
if (closeBagButton == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
closeBagButton.onClick.RemoveListener(HandleCloseBagClicked);
|
||||
closeBagButton.onClick.AddListener(HandleCloseBagClicked);
|
||||
}
|
||||
|
||||
private void UnbindCloseButton()
|
||||
{
|
||||
if (closeBagButton == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
closeBagButton.onClick.RemoveListener(HandleCloseBagClicked);
|
||||
}
|
||||
|
||||
private void SelectDefaultPanel()
|
||||
{
|
||||
if (equipUpdate != null)
|
||||
@@ -163,6 +187,18 @@ public class UI_userBag : MonoBehaviour
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleCloseBagClicked()
|
||||
{
|
||||
uBag bagRoot = GetComponentInParent<uBag>();
|
||||
if (bagRoot != null)
|
||||
{
|
||||
Destroy(bagRoot.gameObject);
|
||||
return;
|
||||
}
|
||||
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
private void ApplyPanelState(GameObject activeObject)
|
||||
{
|
||||
SetObjectActive(equipUpdateObj, activeObject == equipUpdateObj);
|
||||
|
||||
Reference in New Issue
Block a user