Class EditorUtility
Inheritance
EditorUtility
Assembly: UnityEditor.dll
Syntax
public class EditorUtility
Properties
audioMasterMute
Declaration
public static bool audioMasterMute { get; set; }
Property Value
scriptCompilationFailed
Declaration
public static bool scriptCompilationFailed { get; }
Property Value
Methods
|
Improve this Doc
View Source
BuildResourceFile(Object[], String)
Declaration
[Obsolete("Use BuildPipeline.BuildAssetBundle instead")]
public static bool BuildResourceFile(Object[] selection, string pathName)
Parameters
Returns
ClearProgressBar()
Declaration
public static void ClearProgressBar()
CollectDeepHierarchy(Object[])
Declaration
public static Object[] CollectDeepHierarchy(Object[] roots)
Parameters
Type |
Name |
Description |
Object[] |
roots |
|
Returns
CollectDependencies(Object[])
Declaration
public static Object[] CollectDependencies(Object[] roots)
Parameters
Type |
Name |
Description |
Object[] |
roots |
|
Returns
|
Improve this Doc
View Source
CompileCSharp(String[], String[], String[], String)
Declaration
public static string[] CompileCSharp(string[] sources, string[] references, string[] defines, string outputFile)
Parameters
Returns
CompressCubemapTexture(Cubemap, TextureFormat, Int32)
Declaration
public static void CompressCubemapTexture(Cubemap texture, TextureFormat format, int quality)
Parameters
|
Improve this Doc
View Source
CompressCubemapTexture(Cubemap, TextureFormat, TextureCompressionQuality)
Declaration
public static void CompressCubemapTexture(Cubemap texture, TextureFormat format, TextureCompressionQuality quality)
Parameters
CompressTexture(Texture2D, TextureFormat, Int32)
Declaration
public static void CompressTexture(Texture2D texture, TextureFormat format, int quality)
Parameters
|
Improve this Doc
View Source
CompressTexture(Texture2D, TextureFormat, TextureCompressionQuality)
Declaration
public static void CompressTexture(Texture2D texture, TextureFormat format, TextureCompressionQuality quality)
Parameters
CopySerialized(Object, Object)
Declaration
public static void CopySerialized(Object source, Object dest)
Parameters
|
Improve this Doc
View Source
CopySerializedIfDifferent(Object, Object)
Declaration
public static void CopySerializedIfDifferent(Object source, Object dest)
Parameters
CopySerializedManagedFieldsOnly(Object, Object)
Declaration
public static void CopySerializedManagedFieldsOnly(object source, object dest)
Parameters
|
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
|
Improve this Doc
View Source
CreateGameObjectWithHideFlags(String, HideFlags, Type[])
Declaration
public static GameObject CreateGameObjectWithHideFlags(string name, HideFlags flags, params Type[] components)
Parameters
Returns
DisplayCancelableProgressBar(String, String, Single)
Declaration
public static bool DisplayCancelableProgressBar(string title, string info, float progress)
Parameters
Returns
|
Improve this Doc
View Source
Declaration
public static void DisplayCustomMenu(Rect position, GUIContent[] options, Func<int, bool> checkEnabled, int selected, EditorUtility.SelectMenuItemFunction callback, object userData, bool showHotkey = false)
Parameters
|
Improve this Doc
View Source
Declaration
public static void DisplayCustomMenu(Rect position, GUIContent[] options, int selected, EditorUtility.SelectMenuItemFunction callback, object userData)
Parameters
|
Improve this Doc
View Source
Declaration
public static void DisplayCustomMenu(Rect position, GUIContent[] options, int selected, EditorUtility.SelectMenuItemFunction callback, object userData, bool showHotkey)
Parameters
|
Improve this Doc
View Source
DisplayDialog(String, String, String)
Declaration
[ExcludeFromDocs]
public static bool DisplayDialog(string title, string message, string ok)
Parameters
Returns
DisplayDialog(String, String, String, String)
Declaration
public static bool DisplayDialog(string title, string message, string ok, [DefaultValue("\"\"")] string cancel)
Parameters
Returns
DisplayDialogComplex(String, String, String, String, String)
Declaration
public static int DisplayDialogComplex(string title, string message, string ok, string cancel, string alt)
Parameters
Returns
|
Improve this Doc
View Source
DisplayPopupMenu(Rect, String, MenuCommand)
Declaration
public static void DisplayPopupMenu(Rect position, string menuItemPath, MenuCommand command)
Parameters
DisplayProgressBar(String, String, Single)
Declaration
public static void DisplayProgressBar(string title, string info, float progress)
Parameters
Declaration
public static bool ExtractOggFile(Object obj, string path)
Parameters
Returns
FindAsset(String, Type)
Declaration
[Obsolete("Use AssetDatabase.LoadAssetAtPath", false)]
public static Object FindAsset(string path, Type type)
Parameters
Returns
|
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
Returns
|
Improve this Doc
View Source
FocusProjectWindow()
Declaration
public static void FocusProjectWindow()
|
Improve this Doc
View Source
Declaration
public static string FormatBytes(int bytes)
Parameters
Type |
Name |
Description |
Int32 |
bytes |
|
Returns
Declaration
public static string FormatBytes(long bytes)
Parameters
Type |
Name |
Description |
Int64 |
bytes |
|
Returns
|
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
GetObjectEnabled(Object)
Declaration
public static int GetObjectEnabled(Object target)
Parameters
Type |
Name |
Description |
Object |
target |
|
Returns
|
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
|
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
InstanceIDToObject(Int32)
Declaration
public static Object InstanceIDToObject(int instanceID)
Parameters
Type |
Name |
Description |
Int32 |
instanceID |
|
Returns
|
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
Declaration
public static string InvokeDiffTool(string leftTitle, string leftFile, string rightTitle, string rightFile, string ancestorTitle, string ancestorFile)
Parameters
Returns
IsPersistent(Object)
Declaration
public static bool IsPersistent(Object target)
Parameters
Type |
Name |
Description |
Object |
target |
|
Returns
|
Improve this Doc
View Source
LoadWindowLayout(String)
Declaration
public static bool LoadWindowLayout(string path)
Parameters
Type |
Name |
Description |
String |
path |
|
Returns
NaturalCompare(String, String)
Declaration
public static int NaturalCompare(string a, string b)
Parameters
Returns
OpenFilePanel(String, String, String)
Declaration
public static string OpenFilePanel(string title, string directory, string extension)
Parameters
Returns
|
Improve this Doc
View Source
OpenFilePanelWithFilters(String, String, String[])
Declaration
public static string OpenFilePanelWithFilters(string title, string directory, string[] filters)
Parameters
Returns
OpenFolderPanel(String, String, String)
Declaration
public static string OpenFolderPanel(string title, string folder, string defaultName)
Parameters
Returns
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
Returns
|
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
Returns
|
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
Returns
|
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
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
Returns
|
Improve this Doc
View Source
SaveFilePanelInProject(String, String, String, String)
Declaration
public static string SaveFilePanelInProject(string title, string defaultName, string extension, string message)
Parameters
Returns
|
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
Returns
SaveFolderPanel(String, String, String)
Declaration
public static string SaveFolderPanel(string title, string folder, string defaultName)
Parameters
Returns
SetCameraAnimateMaterials(Camera, Boolean)
Declaration
public static void SetCameraAnimateMaterials(Camera camera, bool animate)
Parameters
SetCameraAnimateMaterialsTime(Camera, Single)
Declaration
public static void SetCameraAnimateMaterialsTime(Camera camera, float time)
Parameters
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
SetSelectedRenderState(Renderer, EditorSelectedRenderState)
Declaration
public static void SetSelectedRenderState(Renderer renderer, EditorSelectedRenderState renderState)
Parameters
|
Improve this Doc
View Source
SetSelectedWireframeHidden(Renderer, Boolean)
Declaration
[Obsolete("Use EditorUtility.SetSelectedRenderState", false)]
public static void SetSelectedWireframeHidden(Renderer renderer, bool enabled)
Parameters
|
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
Declaration
public static void UnloadUnusedAssetsImmediate()
|
Improve this Doc
View Source
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
Returns
Extension Methods