/// <summary> /// Must be called in edit mode from NiceUI Kit -> Remove Drawer Panel menu /// </summary> public void RemoveNavigationDrawerPanel() { #if UNITY_EDITOR if (NavigationDrawerPanel != null && !Application.isPlaying) { DestroyImmediate(NavigationDrawerPanel.gameObject); m_NavigationDrawerPanel = null; } #endif }
public void AddNavigationDrawerPanel() { #if UNITY_EDITOR if (NavigationDrawerPanel == null && !Application.isPlaying) { m_NavigationDrawerPanel = ComponentUtils.InstantiatePrefab("NavigationDrawerPanel_pfb")?.GetComponent<NavigationDrawerPanel>(); if (m_NavigationDrawerPanel != null) { m_NavigationDrawerPanel.transform.SetParent(GetComponent<RectTransform>(), false); } EditorUtility.DisplayDialog("Information", "Navigation Drawer panel has been successfully added!", "Ok"); return; } EditorUtility.DisplayDialog("Information", "You only need one drawer panel per application.\nAdding more is useless.", "Ok"); #endif }