Show / Hide Table of Contents

Class EditorUtility

Inheritance
Object
EditorUtility
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: UnityEditor
Assembly: UnityEditor.dll
Syntax
public class EditorUtility

Properties

audioMasterMute

Declaration
public static bool audioMasterMute { get; set; }
Property Value
Type Description
Boolean

scriptCompilationFailed

Declaration
public static bool scriptCompilationFailed { get; }
Property Value
Type Description
Boolean

Methods

| Improve this Doc View Source

BuildResourceFile(Object[], String)

Declaration
[Obsolete("Use BuildPipeline.BuildAssetBundle instead")]
public static bool BuildResourceFile(Object[] selection, string pathName)
Parameters
Type Name Description
Object[] selection
String pathName
Returns
Type Description
Boolean

ClearProgressBar()

Declaration
public static void ClearProgressBar()

CollectDeepHierarchy(Object[])

Declaration
public static Object[] CollectDeepHierarchy(Object[] roots)
Parameters
Type Name Description
Object[] roots
Returns
Type Description
Object[]

CollectDependencies(Object[])

Declaration
public static Object[] CollectDependencies(Object[] roots)
Parameters
Type Name Description
Object[] roots
Returns
Type Description
Object[]
| Improve this Doc View Source

CompileCSharp(String[], String[], String[], String)

Declaration
public static string[] CompileCSharp(string[] sources, string[] references, string[] defines, string outputFile)
Parameters
Type Name Description
String[] sources
String[] references
String[] defines
String outputFile
Returns
Type Description
String[]

CompressCubemapTexture(Cubemap, TextureFormat, Int32)

Declaration
public static void CompressCubemapTexture(Cubemap texture, TextureFormat format, int quality)
Parameters
Type Name Description
Cubemap texture
TextureFormat format
Int32 quality
| Improve this Doc View Source

CompressCubemapTexture(Cubemap, TextureFormat, TextureCompressionQuality)

Declaration
public static void CompressCubemapTexture(Cubemap texture, TextureFormat format, TextureCompressionQuality quality)
Parameters
Type Name Description
Cubemap texture
TextureFormat format
TextureCompressionQuality quality

CompressTexture(Texture2D, TextureFormat, Int32)

Declaration
public static void CompressTexture(Texture2D texture, TextureFormat format, int quality)
Parameters
Type Name Description
Texture2D texture
TextureFormat format
Int32 quality
| Improve this Doc View Source

CompressTexture(Texture2D, TextureFormat, TextureCompressionQuality)

Declaration
public static void CompressTexture(Texture2D texture, TextureFormat format, TextureCompressionQuality quality)
Parameters
Type Name Description
Texture2D texture
TextureFormat format
TextureCompressionQuality quality

CopySerialized(Object, Object)

Declaration
public static void CopySerialized(Object source, Object dest)
Parameters
Type Name Description
Object source
Object dest
| Improve this Doc View Source

CopySerializedIfDifferent(Object, Object)

Declaration
public static void CopySerializedIfDifferent(Object source, Object dest)
Parameters
Type Name Description
Object source
Object dest

CopySerializedManagedFieldsOnly(Object, Object)

Declaration
public static void CopySerializedManagedFieldsOnly(object source, object dest)
Parameters
Type Name Description
Object source
Object dest
| Improve this Doc View Source

CreateEmptyPrefab(String)

Declaration
[Obsolete("The concept of creating a completely empty Prefab has been discontinued. You can however use PrefabUtility.SaveAsPrefabAsset with an empty GameObject.", false)]
public static Object CreateEmptyPrefab(string path)
Parameters
Type Name Description
String path
Returns
Type Description
Object
| Improve this Doc View Source

CreateGameObjectWithHideFlags(String, HideFlags, Type[])

Declaration
public static GameObject CreateGameObjectWithHideFlags(string name, HideFlags flags, params Type[] components)
Parameters
Type Name Description
String name
HideFlags flags
Type[] components
Returns
Type Description
GameObject

DisplayCancelableProgressBar(String, String, Single)

Declaration
public static bool DisplayCancelableProgressBar(string title, string info, float progress)
Parameters
Type Name Description
String title
String info
Single progress
Returns
Type Description
Boolean
| Improve this Doc View Source

DisplayCustomMenu(Rect, GUIContent[], Func<Int32, Boolean>, Int32, EditorUtility.SelectMenuItemFunction, Object, Boolean)

Declaration
public static void DisplayCustomMenu(Rect position, GUIContent[] options, Func<int, bool> checkEnabled, int selected, EditorUtility.SelectMenuItemFunction callback, object userData, bool showHotkey = false)
Parameters
Type Name Description
Rect position
GUIContent[] options
Func<Int32, Boolean> checkEnabled
Int32 selected
EditorUtility.SelectMenuItemFunction callback
Object userData
Boolean showHotkey
| Improve this Doc View Source

DisplayCustomMenu(Rect, GUIContent[], Int32, EditorUtility.SelectMenuItemFunction, Object)

Declaration
public static void DisplayCustomMenu(Rect position, GUIContent[] options, int selected, EditorUtility.SelectMenuItemFunction callback, object userData)
Parameters
Type Name Description
Rect position
GUIContent[] options
Int32 selected
EditorUtility.SelectMenuItemFunction callback
Object userData
| Improve this Doc View Source

DisplayCustomMenu(Rect, GUIContent[], Int32, EditorUtility.SelectMenuItemFunction, Object, Boolean)

Declaration
public static void DisplayCustomMenu(Rect position, GUIContent[] options, int selected, EditorUtility.SelectMenuItemFunction callback, object userData, bool showHotkey)
Parameters
Type Name Description
Rect position
GUIContent[] options
Int32 selected
EditorUtility.SelectMenuItemFunction callback
Object userData
Boolean showHotkey
| Improve this Doc View Source

DisplayDialog(String, String, String)

Declaration
[ExcludeFromDocs]
public static bool DisplayDialog(string title, string message, string ok)
Parameters
Type Name Description
String title
String message
String ok
Returns
Type Description
Boolean

DisplayDialog(String, String, String, String)

Declaration
public static bool DisplayDialog(string title, string message, string ok, [DefaultValue("\"\"")] string cancel)
Parameters
Type Name Description
String title
String message
String ok
String cancel
Returns
Type Description
Boolean

DisplayDialogComplex(String, String, String, String, String)

Declaration
public static int DisplayDialogComplex(string title, string message, string ok, string cancel, string alt)
Parameters
Type Name Description
String title
String message
String ok
String cancel
String alt
Returns
Type Description
Int32
| Improve this Doc View Source

DisplayPopupMenu(Rect, String, MenuCommand)

Declaration
public static void DisplayPopupMenu(Rect position, string menuItemPath, MenuCommand command)
Parameters
Type Name Description
Rect position
String menuItemPath
MenuCommand command

DisplayProgressBar(String, String, Single)

Declaration
public static void DisplayProgressBar(string title, string info, float progress)
Parameters
Type Name Description
String title
String info
Single progress

ExtractOggFile(Object, String)

Declaration
public static bool ExtractOggFile(Object obj, string path)
Parameters
Type Name Description
Object obj
String path
Returns
Type Description
Boolean

FindAsset(String, Type)

Declaration
[Obsolete("Use AssetDatabase.LoadAssetAtPath", false)]
public static Object FindAsset(string path, Type type)
Parameters
Type Name Description
String path
Type type
Returns
Type Description
Object
| Improve this Doc View Source

FindPrefabRoot(GameObject)

Declaration
[Obsolete("Use PrefabUtility.GetOutermostPrefabInstanceRoot if source is a Prefab instance or source.transform.root.gameObject if source is a Prefab Asset object.", false)]
public static GameObject FindPrefabRoot(GameObject source)
Parameters
Type Name Description
GameObject source
Returns
Type Description
GameObject
| Improve this Doc View Source

FocusProjectWindow()

Declaration
public static void FocusProjectWindow()
| Improve this Doc View Source

FormatBytes(Int32)

Declaration
public static string FormatBytes(int bytes)
Parameters
Type Name Description
Int32 bytes
Returns
Type Description
String

FormatBytes(Int64)

Declaration
public static string FormatBytes(long bytes)
Parameters
Type Name Description
Int64 bytes
Returns
Type Description
String
| Improve this Doc View Source

GetAssetPath(Object)

Declaration
[Obsolete("Use AssetDatabase.GetAssetPath", false)]
public static string GetAssetPath(Object asset)
Parameters
Type Name Description
Object asset
Returns
Type Description
String

GetObjectEnabled(Object)

Declaration
public static int GetObjectEnabled(Object target)
Parameters
Type Name Description
Object target
Returns
Type Description
Int32
| Improve this Doc View Source

GetPrefabParent(Object)

Declaration
[Obsolete("Use PrefabUtility.GetCorrespondingObjectFromSource.", false)]
public static Object GetPrefabParent(Object source)
Parameters
Type Name Description
Object source
Returns
Type Description
Object
| Improve this Doc View Source

GetPrefabType(Object)

Declaration
[Obsolete("Use PrefabUtility.GetPrefabAssetType and PrefabUtility.GetPrefabInstanceStatus to get the full picture about Prefab types.", false)]
public static PrefabType GetPrefabType(Object target)
Parameters
Type Name Description
Object target
Returns
Type Description
PrefabType

InstanceIDToObject(Int32)

Declaration
public static Object InstanceIDToObject(int instanceID)
Parameters
Type Name Description
Int32 instanceID
Returns
Type Description
Object
| Improve this Doc View Source

InstantiatePrefab(Object)

Declaration
[Obsolete("Use PrefabUtility.InstantiatePrefab", false)]
public static Object InstantiatePrefab(Object target)
Parameters
Type Name Description
Object target
Returns
Type Description
Object

InvokeDiffTool(String, String, String, String, String, String)

Declaration
public static string InvokeDiffTool(string leftTitle, string leftFile, string rightTitle, string rightFile, string ancestorTitle, string ancestorFile)
Parameters
Type Name Description
String leftTitle
String leftFile
String rightTitle
String rightFile
String ancestorTitle
String ancestorFile
Returns
Type Description
String

IsPersistent(Object)

Declaration
public static bool IsPersistent(Object target)
Parameters
Type Name Description
Object target
Returns
Type Description
Boolean
| Improve this Doc View Source

LoadWindowLayout(String)

Declaration
public static bool LoadWindowLayout(string path)
Parameters
Type Name Description
String path
Returns
Type Description
Boolean

NaturalCompare(String, String)

Declaration
public static int NaturalCompare(string a, string b)
Parameters
Type Name Description
String a
String b
Returns
Type Description
Int32

OpenFilePanel(String, String, String)

Declaration
public static string OpenFilePanel(string title, string directory, string extension)
Parameters
Type Name Description
String title
String directory
String extension
Returns
Type Description
String
| Improve this Doc View Source

OpenFilePanelWithFilters(String, String, String[])

Declaration
public static string OpenFilePanelWithFilters(string title, string directory, string[] filters)
Parameters
Type Name Description
String title
String directory
String[] filters
Returns
Type Description
String

OpenFolderPanel(String, String, String)

Declaration
public static string OpenFolderPanel(string title, string folder, string defaultName)
Parameters
Type Name Description
String title
String folder
String defaultName
Returns
Type Description
String

OpenWithDefaultApp(String)

Declaration
public static void OpenWithDefaultApp(string fileName)
Parameters
Type Name Description
String fileName
| Improve this Doc View Source

ReconnectToLastPrefab(GameObject)

Declaration
[Obsolete("Use PrefabUtility.RevertPrefabInstance.", false)]
public static bool ReconnectToLastPrefab(GameObject go)
Parameters
Type Name Description
GameObject go
Returns
Type Description
Boolean
| Improve this Doc View Source

ReplacePrefab(GameObject, Object)

Declaration
[Obsolete("Use PrefabUtility.SaveAsPrefabAsset or PrefabUtility.SaveAsPrefabAssetAndConnect with a path instead.", false)]
public static GameObject ReplacePrefab(GameObject go, Object targetPrefab)
Parameters
Type Name Description
GameObject go
Object targetPrefab
Returns
Type Description
GameObject
| Improve this Doc View Source

ReplacePrefab(GameObject, Object, ReplacePrefabOptions)

Declaration
[Obsolete("Use PrefabUtility.SaveAsPrefabAsset with a path instead.", false)]
public static GameObject ReplacePrefab(GameObject go, Object targetPrefab, ReplacePrefabOptions options)
Parameters
Type Name Description
GameObject go
Object targetPrefab
ReplacePrefabOptions options
Returns
Type Description
GameObject
| Improve this Doc View Source

ResetToPrefabState(Object)

Declaration
[Obsolete("Use PrefabUtility.RevertObjectOverride.", false)]
public static bool ResetToPrefabState(Object source)
Parameters
Type Name Description
Object source
Returns
Type Description
Boolean

RevealInFinder(String)

Declaration
public static void RevealInFinder(string path)
Parameters
Type Name Description
String path

SaveFilePanel(String, String, String, String)

Declaration
public static string SaveFilePanel(string title, string directory, string defaultName, string extension)
Parameters
Type Name Description
String title
String directory
String defaultName
String extension
Returns
Type Description
String
| Improve this Doc View Source

SaveFilePanelInProject(String, String, String, String)

Declaration
public static string SaveFilePanelInProject(string title, string defaultName, string extension, string message)
Parameters
Type Name Description
String title
String defaultName
String extension
String message
Returns
Type Description
String
| Improve this Doc View Source

SaveFilePanelInProject(String, String, String, String, String)

Declaration
public static string SaveFilePanelInProject(string title, string defaultName, string extension, string message, string path)
Parameters
Type Name Description
String title
String defaultName
String extension
String message
String path
Returns
Type Description
String

SaveFolderPanel(String, String, String)

Declaration
public static string SaveFolderPanel(string title, string folder, string defaultName)
Parameters
Type Name Description
String title
String folder
String defaultName
Returns
Type Description
String

SetCameraAnimateMaterials(Camera, Boolean)

Declaration
public static void SetCameraAnimateMaterials(Camera camera, bool animate)
Parameters
Type Name Description
Camera camera
Boolean animate

SetCameraAnimateMaterialsTime(Camera, Single)

Declaration
public static void SetCameraAnimateMaterialsTime(Camera camera, float time)
Parameters
Type Name Description
Camera camera
Single time

SetDirty(Object)

Declaration
public static void SetDirty(Object target)
Parameters
Type Name Description
Object target

SetObjectEnabled(Object, Boolean)

Declaration
public static void SetObjectEnabled(Object target, bool enabled)
Parameters
Type Name Description
Object target
Boolean enabled

SetSelectedRenderState(Renderer, EditorSelectedRenderState)

Declaration
public static void SetSelectedRenderState(Renderer renderer, EditorSelectedRenderState renderState)
Parameters
Type Name Description
Renderer renderer
EditorSelectedRenderState renderState
| Improve this Doc View Source

SetSelectedWireframeHidden(Renderer, Boolean)

Declaration
[Obsolete("Use EditorUtility.SetSelectedRenderState", false)]
public static void SetSelectedWireframeHidden(Renderer renderer, bool enabled)
Parameters
Type Name Description
Renderer renderer
Boolean enabled
| Improve this Doc View Source

UnloadUnusedAssets()

Declaration
[Obsolete("Use EditorUtility.UnloadUnusedAssetsImmediate instead", false)]
public static void UnloadUnusedAssets()
| Improve this Doc View Source

UnloadUnusedAssetsIgnoreManagedReferences()

Declaration
[Obsolete("Use EditorUtility.UnloadUnusedAssetsImmediate instead", false)]
public static void UnloadUnusedAssetsIgnoreManagedReferences()
| Improve this Doc View Source

UnloadUnusedAssetsImmediate()

Declaration
public static void UnloadUnusedAssetsImmediate()
| Improve this Doc View Source

UnloadUnusedAssetsImmediate(Boolean)

Declaration
public static void UnloadUnusedAssetsImmediate(bool includeMonoReferencesAsRoots)
Parameters
Type Name Description
Boolean includeMonoReferencesAsRoots

UpdateGlobalShaderProperties(Single)

Declaration
public static void UpdateGlobalShaderProperties(float time)
Parameters
Type Name Description
Single time

WarnPrefab(Object, String, String, String)

Declaration
public static bool WarnPrefab(Object target, string title, string warning, string okButton)
Parameters
Type Name Description
Object target
String title
String warning
String okButton
Returns
Type Description
Boolean

Extension Methods

MustExtensions.MustBeEqual<T>(T, T)
MustExtensions.MustBeEqual<T>(T, T, String)
MustExtensions.MustNotBeEqual<T>(T, T)
MustExtensions.MustNotBeEqual<T>(T, T, String)
MustExtensions.MustBeNull<T>(T)
MustExtensions.MustBeNull<T>(T, String)
MustExtensions.MustNotBeNull<T>(T)
MustExtensions.MustNotBeNull<T>(T, String)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX