public void SetActivePanel(SlideCanvasGroup panel) { if (activePanel == null) { //Opening new panel panel.Open(); activePanel = panel; } else { //Changing panel if (activePanel != panel) { CloseActivePanel(); panel.Open(); activePanel = panel; } else { //Closing active panel CloseActivePanel(); } } }
public void CloseActivePanel() { activePanel.Close(); activePanel = null; }