// Panel Management public void SwitchPanel(PBS.Battle.View.Enums.Panel newPanel) { panelType = newPanel; if (currentPanel != null) { currentPanel.gameObject.SetActive(false); } switch (newPanel) { case PBS.Battle.View.Enums.Panel.Command: currentPanel = cmdPanel; break; case PBS.Battle.View.Enums.Panel.Fight: currentPanel = fightPanel; break; case PBS.Battle.View.Enums.Panel.FieldTargeting: currentPanel = fieldTargetPanel; break; case PBS.Battle.View.Enums.Panel.Party: currentPanel = partyPanel; partyPanel.commandPanel.gameObject.SetActive(false); break; case PBS.Battle.View.Enums.Panel.PartyCommand: currentPanel = partyPanel; partyPanel.commandPanel.gameObject.SetActive(true); break; case PBS.Battle.View.Enums.Panel.Bag: currentPanel = bagPanel; break; case PBS.Battle.View.Enums.Panel.BagItem: currentPanel = bagItemPanel; break; default: currentPanel = null; break; } if (currentPanel != null) { currentPanel.gameObject.SetActive(true); } // HUD (only on None or Fight Panels) HUDPanel.gameObject.SetActive( panelType == PBS.Battle.View.Enums.Panel.None || panelType == PBS.Battle.View.Enums.Panel.Command); }
void Awake() { currentPanel = null; }