void OnEnable() { var assetPath = AssetDatabase.GetAssetPath(target); scenePrefab = ScenePrefabUtility.GetScenePrefab(assetPath); if (scenePrefab == null) { scenePrefab = ScenePrefabUtility.CreateScenePrefab(assetPath); } InitActiveEditors(); Undo.undoRedoPerformed += InitActiveEditors; }
void OnEnable() { var assetPath = AssetDatabase.GetAssetPath(target); isSceneInspector = Path.GetExtension(assetPath) == ".unity"; if (isSceneInspector == false) { return; } scenePrefab = ScenePrefabUtility.GetScenePrefab(assetPath); if (scenePrefab == null) { scenePrefab = ScenePrefabUtility.CreateScenePrefab(assetPath); } InitActiveEditors(); Undo.undoRedoPerformed += InitActiveEditors; }