private void Load() { var prefab = Resources.Load<DebugPanelRoot>(SRDebugPaths.DebugPanelPrefabPath); if (prefab == null) { Debug.LogError("[SRDebugger] Error loading debug panel prefab"); return; } _debugPanelRootObject = SRInstantiate.Instantiate(prefab); _debugPanelRootObject.name = "Panel"; DontDestroyOnLoad(_debugPanelRootObject); _debugPanelRootObject.CachedTransform.SetParent(Hierarchy.Get("SRDebugger"), true); SRDebuggerUtil.EnsureEventSystemExists(); }
public void Unload() { if (_debugPanelRootObject == null) { return; } IsVisible = false; _debugPanelRootObject.CachedGameObject.SetActive(false); Destroy(_debugPanelRootObject.CachedGameObject); _debugPanelRootObject = null; }