public static bool RevealInSettings(AssetSettingsKind settingsKind, string path = null) { var result = true; switch (settingsKind) { case AssetSettingsKind.AudioManager: case AssetSettingsKind.ClusterInputManager: case AssetSettingsKind.InputManager: case AssetSettingsKind.NavMeshAreas: case AssetSettingsKind.NavMeshLayers: case AssetSettingsKind.NavMeshProjectSettings: case AssetSettingsKind.NetworkManager: break; case AssetSettingsKind.NotSettings: Debug.LogWarning(Maintainer.ConstructWarning("Can't open settings of kind NotSettings Oo")); result = false; break; case AssetSettingsKind.DynamicsManager: if (!CSMenuTools.ShowProjectSettingsPhysics()) { Debug.LogError(Maintainer.ConstructError("Can't open Physics Settings!")); result = false; } break; case AssetSettingsKind.EditorBuildSettings: if (!CSMenuTools.ShowEditorBuildSettings()) { Debug.LogError(Maintainer.ConstructError("Can't open EditorBuildSettings!")); result = false; } break; case AssetSettingsKind.EditorSettings: if (!CSMenuTools.ShowEditorSettings()) { Debug.LogError(Maintainer.ConstructError("Can't open Editor Settings!")); result = false; } break; case AssetSettingsKind.GraphicsSettings: if (!CSMenuTools.ShowProjectSettingsGraphics()) { Debug.LogError(Maintainer.ConstructError("Can't open GraphicsSettings!")); result = false; } break; case AssetSettingsKind.Physics2DSettings: if (!CSMenuTools.ShowProjectSettingsPhysics2D()) { Debug.LogError(Maintainer.ConstructError("Can't open Physics2D Settings!")); result = false; } break; case AssetSettingsKind.ProjectSettings: if (!CSMenuTools.ShowProjectSettingsPlayer()) { Debug.LogError(Maintainer.ConstructError("Can't open Player Settings!")); result = false; } break; case AssetSettingsKind.PresetManager: if (!CSMenuTools.ShowProjectSettingsPresetManager()) { Debug.LogError(Maintainer.ConstructError("Can't open Preset Manager!")); result = false; } break; case AssetSettingsKind.QualitySettings: break; case AssetSettingsKind.TagManager: if (!CSMenuTools.ShowProjectSettingsTagsAndLayers()) { Debug.LogError(Maintainer.ConstructError("Can't open Tags and Layers Settings!")); result = false; } break; case AssetSettingsKind.TimeManager: break; case AssetSettingsKind.UnityAdsSettings: break; case AssetSettingsKind.UnityConnectSettings: break; case AssetSettingsKind.VFXManager: if (!CSMenuTools.ShowProjectSettingsVFX()) { Debug.LogError(Maintainer.ConstructError("Can't open VFX Settings!")); result = false; } break; case AssetSettingsKind.Unknown: if (!string.IsNullOrEmpty(path)) { EditorUtility.RevealInFinder(path); } break; default: throw new ArgumentOutOfRangeException(); } return(result); }
public static void RevealAndSelectReferencingEntry(string assetPath, ReferencingEntryData referencingEntry) { if (!string.IsNullOrEmpty(assetPath) && (referencingEntry.location == Location.SceneLightingSettings || referencingEntry.location == Location.SceneNavigationSettings)) { var sceneOpenResult = CSSceneTools.OpenSceneWithSavePrompt(assetPath); if (!sceneOpenResult.success) { Debug.LogError(Maintainer.ConstructError("Can't open scene " + assetPath)); MaintainerWindow.ShowNotification("Can't show it properly"); return; } } switch (referencingEntry.location) { case Location.ScriptAsset: case Location.ScriptableObjectAsset: if (!RevealAndSelectFileAsset(assetPath)) { MaintainerWindow.ShowNotification("Can't show it properly"); } break; case Location.PrefabAssetObject: if (!RevealAndSelectSubAsset(assetPath, referencingEntry.transformPath, referencingEntry.objectId)) { MaintainerWindow.ShowNotification("Can't show it properly"); } break; case Location.PrefabAssetGameObject: case Location.SceneGameObject: if (!RevealAndSelectGameObject(assetPath, referencingEntry.transformPath, referencingEntry.objectId, referencingEntry.componentId)) { MaintainerWindow.ShowNotification("Can't show it properly"); } break; case Location.SceneLightingSettings: if (!CSMenuTools.ShowSceneSettingsLighting()) { Debug.LogError(Maintainer.ConstructError("Can't open Lighting settings!")); MaintainerWindow.ShowNotification("Can't show it properly"); } break; case Location.SceneNavigationSettings: if (!CSMenuTools.ShowSceneSettingsNavigation()) { Debug.LogError(Maintainer.ConstructError("Can't open Navigation settings!")); MaintainerWindow.ShowNotification("Can't show it properly"); } break; case Location.NotFound: case Location.Invisible: break; case Location.TileMap: if (!RevealAndSelectGameObject(assetPath, referencingEntry.transformPath, referencingEntry.objectId, referencingEntry.componentId)) { MaintainerWindow.ShowNotification("Can't show it properly"); } // TODO: open tile map editor window? break; default: throw new ArgumentOutOfRangeException(); } }