private void DisableAllPanels() { IUIPanel panel = null; for (int i = 0; i < Panels.Count; i++) { panel = Panels[i].GetComponent <IUIPanel>(); if (panel != null) { panel.TogglePanel(false); } } }
public void TogglePanel(string panelName, bool state) { IUIPanel panel = null; for (int i = 0; i < Panels.Count; i++) { panel = Panels[i].GetComponent <IUIPanel>(); if (panel != null) { if (panel.PanelName == panelName) { panel.TogglePanel(state); } } } }