示例#1
0
    // Panel Management
    public override void SwitchPanel(Panel newPanel)
    {
        panelType = newPanel;
        if (currentPanel != null)
        {
            currentPanel.gameObject.SetActive(false);
        }

        switch (newPanel)
        {
        case Panel.Command:
            currentPanel = cmdPanel;
            break;

        case Panel.Fight:
            currentPanel = fightPanel;
            break;

        case Panel.FieldTargeting:
            currentPanel = fieldTargetPanel;
            break;

        case Panel.Party:
            currentPanel = partyPanel;
            partyPanel.commandPanel.gameObject.SetActive(false);
            break;

        case Panel.PartyCommand:
            currentPanel = partyPanel;
            partyPanel.commandPanel.gameObject.SetActive(true);
            break;

        case Panel.Bag:
            currentPanel = bagPanel;
            break;

        case 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 == Panel.None ||
            panelType == Panel.Command);
    }
示例#2
0
 protected override void Awake()
 {
     base.Awake();
     currentPanel = null;
 }