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 (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)

update

Delegate for generic updates.

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 scene at path.

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.

Beep

Plays system beep sound.

Delegates
CallbackFunction

Delegate to be called from EditorApplication callbacks.