public UIManager() { pHealthBar = GameObject.Find("HealthBar_Back"); ManaPanel.S_Initialize(); pCharPanel = GameObject.FindObjectOfType <CharacterPanel>(); pInvPanel = GameObject.FindObjectOfType <InventoryPanel>(); InitPanel(pCharPanel); InitPanel(pInvPanel); }
public void TogglePanel(ManaPanel pPanel, bool bOpened) { pCharPanel.UIElementActive = false; pInvPanel.UIElementActive = false; pPanel.UIElementActive = bOpened; bool bNewState = pCharPanel.UIElementActive || pInvPanel.UIElementActive; bool bStateChanged = (m_bUIOpened != bNewState); m_bUIOpened = bNewState; pHealthBar.SetActive(!m_bUIOpened); if (bStateChanged) OnMenuOpenClose(); }
public void TogglePanel(ManaPanel pPanel, bool bOpened) { pCharPanel.UIElementActive = false; pInvPanel.UIElementActive = false; pPanel.UIElementActive = bOpened; bool bNewState = pCharPanel.UIElementActive || pInvPanel.UIElementActive; bool bStateChanged = (m_bUIOpened != bNewState); m_bUIOpened = bNewState; pHealthBar.SetActive(!m_bUIOpened); if (bStateChanged) { OnMenuOpenClose(); } }
void InitPanel(ManaPanel pPanel) { pPanel.Initialize(); TogglePanel(pPanel, false); }