Version: 2022.1
LanguageEnglish
  • C#

EditorUtility

class in UnityEditor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Editor utility functions.

Static Properties

scriptCompilationFailedTrue if there are any compilation error messages in the log.

Static Methods

ClearDefaultParentObjectClears the default parent GameObject from either a specific Scene or the active Scene.
ClearDirtyClear target's dirty flag.
ClearProgressBarRemoves the progress bar.
CollectDeepHierarchyCollect all objects in the hierarchy rooted at each of the given objects.
CollectDependenciesCalculates and returns a list of all assets the assets listed in roots depend on.
CompressCubemapTextureCompress a cubemap texture.
CompressTextureCompress a texture.
CopySerializedCopy all settings of a Unity Object.
CopySerializedIfDifferentCopy all settings of a Unity Object to a second Object if they differ.
CopySerializedManagedFieldsOnlyCopies the serializable fields from one managed object to another.
CreateGameObjectWithHideFlagsCreates a game object with HideFlags and specified components.
DisplayCancelableProgressBarDisplays or updates a progress bar that has a cancel button.
DisplayDialogThis method displays a modal dialog.
DisplayDialogComplexDisplays a modal dialog with three buttons.
DisplayPopupMenuDisplays a popup menu.
DisplayProgressBarDisplays or updates a progress bar.
FocusProjectWindowBrings the project window to the front and focuses it.
FormatBytesReturns a text for a number of bytes.
GetDialogOptOutDecisionThis method displays a modal dialog that lets the user opt-out of being shown the current dialog box again.
GetDirtyCountReturns an integer that indicates the number of times the specified object's serialized properties have changed.
GetObjectEnabledIs the object enabled (0 disabled, 1 enabled, -1 has no enabled button).
InstanceIDToObjectTranslates an instance ID to a reference to an object.
IsDirtyGets a boolean value that indicates whether the specified object has changed since the last time it was saved.
IsPersistentDetermines if an object is stored on disk.
IsRunningUnderCPUEmulationGets a boolean value. This value indicates whether your CPU is unable to execute Unity natively and is running an emulated version.
NaturalCompareHuman-like sorting.
OpenFilePanelDisplays the "open file" dialog and returns the selected path name.
OpenFilePanelWithFiltersDisplays the "open file" dialog and returns the selected path name.
OpenFolderPanelDisplays the "open folder" dialog and returns the selected path name.
OpenPropertyEditorOpen properties editor for an Object.
RequestScriptReloadThe Unity Editor reloads script assemblies asynchronously on the next frame. This resets the state of all the scripts, but Unity does not compile any code that has changed since the previous compilation.
SaveFilePanelDisplays the "save file" dialog and returns the selected path name.
SaveFilePanelInProjectDisplays the "save file" dialog in the Assets folder of the project and returns the selected path name.
SaveFolderPanelDisplays the "save folder" dialog and returns the selected path name.
SetCameraAnimateMaterialsSets this camera to allow animation of materials in the Editor.
SetCameraAnimateMaterialsTimeSets the global time for this camera to use when rendering.
SetCustomDiffToolSet custom diff tool settings.
SetDefaultParentObjectSets the default parent object for the active Scene.
SetDialogOptOutDecisionThis method displays a modal dialog that lets the user opt-out of being shown the current dialog box again.
SetDirtyMarks target object as dirty.
SetObjectEnabledSet the enabled state of the object.
SetSelectedRenderStateSet the Scene View selected display mode for this Renderer.
UnloadUnusedAssetsImmediateUnloads assets that are not used.
UpdateGlobalShaderPropertiesUpdates the global shader properties to use when rendering.