/// <summary> /// Toggle a panel's state /// </summary> /// <param name="name">Panel name</param> public void TogglePanel(string name) { EvermorePanel temp = m_panels.Find(x => x.gameObject.name == name); if (m_temp && !AllowMultiple && temp != m_temp) m_temp.Hide(); m_temp = temp; if (m_temp == null) { Debug.LogWarningFormat("Warning: Panel '{0}' does not exist!", name); return; } m_temp.Toggle(); }
/// <summary> /// Shorthand for disabling gameObjects /// </summary> /// <param name="panel">Panel to set</param> /// <param name="active">State</param> void SetActive(EvermorePanel panel, bool active) { panel.SetActive(active); }
/// <summary> /// Display the specified panel /// </summary> /// <param name="name">Panel to display</param> public void ShowPanel(string name) { // Checks if there is already a panel open if (m_temp && !AllowMultiple) m_temp.Hide(); // Hides it if multiples are prohibited m_temp = m_panels.Find(x => x.name == name); m_temp.Show(); m_temp.Refresh(); }