Last active
November 4, 2022 13:02
-
-
Save Syy9/3334e98c2a37ebd1591fd576aff19633 to your computer and use it in GitHub Desktop.
How to get all EditorWindow types in Unity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
using System.IO; | |
using System.Text; | |
public class CheckTool { | |
[MenuItem("CheckTool/Check")] | |
public static void Check() | |
{ | |
var result = GetUnityTypes.GetEditorWindowTypes(); | |
StringBuilder sb = new StringBuilder(); | |
foreach (var type in result) | |
{ | |
sb.AppendLine(type.ToString()); | |
} | |
Write(sb.ToString()); | |
} | |
private static void Write(string output) | |
{ | |
StreamWriter writer = new StreamWriter("Assets/result.txt", false); | |
writer.Flush(); | |
writer.Write(output); | |
writer.Close(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UnityEditor.Android.AndroidKeystoreWindow | |
UnityEditor.Graphs.AnimatorControllerTool | |
UnityEditor.Graphs.LayerSettingsWindow | |
UnityEditor.Graphs.ParameterControllerEditor | |
UnityEditor.Graphs.AnimationStateMachine.AddStateMachineBehaviourComponentWindow | |
UnityEditor.Timeline.TimelineWindow | |
UnityEditor.TestTools.TestRunner.TestRunnerWindow | |
Unity.PackageManager.UI.Window | |
TMPro.PackageResourceImporterWindow | |
UnityEditor.PackageManager.UI.PackageManagerWindow | |
TMPro.TMP_ProjectConversionUtility | |
TMPro.TMP_SpriteAssetImporter | |
TMPro.EditorUtilities.TMPro_FontAssetCreatorWindow | |
UnityEditor.Experimental.UIElements.GraphView.SearchWindow | |
UnityEditor.LicenseManagementWindow | |
UnityEditor.Presets.PresetSelector | |
UnityEditor.ProfilerIPWindow | |
UnityEditor.ProfilerWindow | |
UnityEditor.UISystemPreviewWindow | |
UnityEditor.SketchUpImportDlg | |
UnityEditor.GridPaintPaletteWindow | |
UnityEditor.GridPaletteAddPopup | |
UnityEditor.UIAutomation.TestEditorWindow | |
UnityEditor.Experimental.UIElements.Debugger.PanelPickerWindow | |
UnityEditor.Experimental.UIElements.Debugger.UIElementsDebugger | |
UnityEditor.BuildPlayerWindow | |
UnityEditor.ConsoleWindow | |
UnityEditor.IconSelector | |
UnityEditor.ObjectSelector | |
UnityEditor.ProjectBrowser | |
UnityEditor.ProjectTemplateWindow | |
UnityEditor.RagdollBuilder | |
UnityEditor.SceneHierarchySortingWindow | |
UnityEditor.SceneHierarchyWindow | |
UnityEditor.ScriptableWizard | |
UnityEditorInternal.AddCurvesPopup | |
UnityEditor.AnimationWindow | |
UnityEditor.CurveEditorWindow | |
UnityEditor.MinMaxCurveEditorWindow | |
UnityEditor.AnnotationWindow | |
UnityEditor.LayerVisibilityWindow | |
UnityEditor.AssetStoreInstaBuyWindow | |
UnityEditor.AssetStoreLoginWindow | |
UnityEditor.AssetStoreWindow | |
UnityEditor.AudioMixerWindow | |
UnityEditor.Collaboration.CollabPublishDialog | |
UnityEditor.Collaboration.CollabCannotPublishDialog | |
UnityEditor.CollabHistoryWindow | |
UnityEditor.CollabToolbarWindow | |
UnityEditor.GameView | |
UnityEditor.AboutWindow | |
UnityEditor.AssetSaveDialog | |
UnityEditor.BumpMapSettingsFixingWindow | |
UnityEditor.ColorPicker | |
UnityEditor.EditorUpdateWindow | |
UnityEditor.FallbackEditorWindow | |
UnityEditor.GradientPicker | |
UnityEditor.PackageExport | |
UnityEditor.PackageImport | |
UnityEditor.PopupWindow | |
UnityEditor.PopupWindowWithoutFocus | |
UnityEditor.PragmaFixingWindow | |
UnityEditor.SaveWindowLayout | |
UnityEditor.DeleteWindowLayout | |
UnityEditor.SnapSettings | |
UnityEditor.TreeViewExamples.TreeViewTestWindow | |
UnityEditor.GUIViewDebuggerWindow | |
UnityEditor.InspectorWindow | |
UnityEditor.PreviewWindow | |
UnityEditor.AddShaderVariantWindow | |
UnityEditor.AddComponentWindow | |
UnityEditor.AdvancedDropdownWindow | |
UnityEditor.LookDevView | |
UnityEditor.ParticleSystemWindow | |
UnityEngine.XR.WSA.HolographicEmulationWindow | |
UnityEditor.FrameDebuggerWindow | |
UnityEditor.PreferencesWindow | |
UnityEditor.SearchableEditorWindow | |
UnityEditor.LightingExplorerWindow | |
UnityEditor.LightingWindow | |
UnityEditor.NavMeshEditorWindow | |
UnityEditor.OcclusionCullingWindow | |
UnityEditor.PhysicsDebugWindow | |
UnityEditor.TierSettingsWindow | |
UnityEditor.SceneView | |
UnityEditorInternal.SpriteEditorMenu | |
UnityEditor.SpriteEditorWindow | |
UnityEditor.Sprites.PackerWindow | |
UnityEditor.SpriteUtilityWindow | |
UnityEditor.TerrainSplatEditor | |
UnityEditor.TerrainWizard | |
UnityEditor.ImportRawHeightmap | |
UnityEditor.ExportRawHeightmap | |
UnityEditor.TreeWizard | |
UnityEditor.DetailMeshWizard | |
UnityEditor.DetailTextureWizard | |
UnityEditor.PlaceTreeWizard | |
UnityEditor.FlattenHeightmap | |
TroubleshooterWindow | |
UnityEditor.UndoWindow | |
UnityEditor.Connect.UnityConnectConsentView | |
UnityEditor.Connect.UnityConnectEditorWindow | |
UnityEditor.MetroCertificatePasswordWindow | |
UnityEditor.MetroCreateTestCertificateWindow | |
UnityEditor.VersionControl.WindowChange | |
UnityEditor.VersionControl.WindowCheckoutFailure | |
UnityEditor.VersionControl.WindowPending | |
UnityEditor.VersionControl.WindowResolve | |
UnityEditor.VersionControl.WindowRevert | |
UnityEditor.Web.WebViewEditorStaticWindow | |
UnityEditor.Web.WebViewEditorWindow | |
UnityEditor.Web.WebViewEditorWindowTabs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Reflection; | |
using UnityEditor; | |
public static class GetUnityTypes | |
{ | |
public static List<Type> GetEditorWindowTypes() | |
{ | |
var result = GetSubClassTypes<EditorWindow>(); | |
return result; | |
} | |
public static List<Type> GetSubClassTypes<BaseType>() | |
{ | |
var result = new List<Type>(); | |
Assembly[] assemblies = System.AppDomain.CurrentDomain.GetAssemblies(); | |
Type editorWindowType = typeof(BaseType); | |
foreach (var assembly in assemblies) | |
{ | |
Type[] types = assembly.GetTypes(); | |
foreach (var type in types) | |
{ | |
if (type.IsSubclassOf(editorWindowType)) | |
{ | |
result.Add(type); | |
} | |
} | |
} | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment