EditorApplication Manual     Reference     Scripting  
Scripting > Editor Classes > EditorApplication
EditorApplication

Main Application class.

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 Variables
currentScene

The path of the scene that the user has currently open (Will be an empty string if no scene is currently open). (Read Only)

isPlaying

Is editor currently in play mode?

isPlayingOrWillChangePlaymode

Is editor either currently in play mode, or about to switch to it? (Read Only)

isPaused

Is editor currently paused?

isCompiling

Is editor currently compiling scripts? (Read Only)

applicationContentsPath

Path to the Unity editor contents folder (Read Only)

applicationPath

Returns the path to the Unity editor application (Read Only)

projectWindowItemOnGUI

Delegate for OnGUI events for every visible list item in the ProjectWindow.

hierarchyWindowItemOnGUI

Delegate for OnGUI events for every visible list item in the HierarchyWindow.

update

Delegate for generic updates.

delayCall

hierarchyWindowChanged

projectWindowChanged

searchChanged

modifierKeysChanged

Delegate for changed keyboard modifier keys.

playmodeStateChanged

Delegate for play mode state changes.

timeSinceStartup

The time since the editor was started (Read Only)

Class Functions
NewScene

Create a new scene

OpenScene

Opens the scene at path.

OpenSceneAdditive

Opens the scene at path additively.

SaveScene

Save the open scene.

SaveCurrentSceneIfUserWantsTo

Ask the user if he wants to save the open scene.

OpenProject

Open another project.

SaveAssets

Saves all serializable assets that have not yet been written to disk (eg. Materials)

Step

Perform a single frame step.

LockReloadAssemblies

Prevents loading of assemblies when it is inconvenient.

ExecuteMenuItem

Invokes the menu item in the specified path.

UnlockReloadAssemblies

Must be called after LockReloadAssemblies, to reenable loading of assemblies.

Exit

Exit the Unity editor application.

RepaintProjectWindow

Can be used to ensure repaint of the ProjectWindow.

RepaintHierarchyWindow

Can be used to ensure repaint of the HierarchyWindow.

Beep

Plays system beep sound.

Delegates
ProjectWindowItemCallback

Delegate to be called for every visible list item in the ProjectWindow on every OnGUI event.

HierarchyWindowItemCallback

Delegate to be called for every visible list item in the HierarchyWindow on every OnGUI event.

CallbackFunction

Delegate to be called from EditorApplication callbacks.