EditorUtility

Editor utility functions.

Note: This is an editor class. To use it you have to place your script in Assets/Editor inside your project folder. Editor classes are in the UnityEditor namespace so for C# scripts you need to add "using UnityEditor;" at the beginning of the script.

Class Functions
SetDirty

Marks target object as dirty.

IsPersistent

Determines if an object is stored on disk.

DisplayDialog

Displays a modal dialog.

DisplayDialogComplex

Displays a modal dialog with three buttons.

OpenFilePanel

Displays the "open file" dialog and returns the selected path name.

SaveFilePanel

Displays the "save file" dialog and returns the selected path name.

OpenFolderPanel

Displays the "open folder" dialog and returns the selected path name.

SaveFolderPanel

Displays the "save folder" dialog and returns the selected path name.

SaveFilePanelInProject

Displays the "save file" dialog in the Assets folder of the project and returns the selected path name.

InstanceIDToObject

Translates an instance ID to a reference to an object.

CompressTexture

Compress a texture.

CopySerialized

Copy all settings of a Unity Object.

CollectDependencies

Calculates and returns a list of all assets the assets listed in roots depend on.

CollectDeepHierarchy

Calculates and returns a list of all assets the assets listed in roots depend on.

UnloadUnusedAssets

Unloads assets that are not used.

UnloadUnusedAssetsIgnoreManagedReferences

Unloads assets that are not used, including the ones that are referenced only from scripts.

DisplayPopupMenu

Displays a popup menu.

FocusProjectWindow

Brings the project window to the front and focuses it.

FormatBytes

Returns a text for a number of bytes.

DisplayProgressBar

Displays or updates a progress bar.

DisplayCancelableProgressBar

Displays or updates a progress bar that has a cancel button.

ClearProgressBar

Removes progress bar.

GetObjectEnabled

Is the object enabled (0 disabled, 1 enabled, -1 has no enabled button)

SetObjectEnabled

Set the enabled state of the object

SetSelectedWireframeHidden

Set whether the renderer's wireframe will be hidden when the renderer's gameobject is selected

ExtractOggFile

Saves an AudioClip or MovieTexture to a file.

CreateGameObjectWithHideFlags

Creates a game object with HideFlags and specified components.