Application Manual     Reference     Scripting  
Scripting > Runtime Classes > Application
Application Class

Access to application run-time data.

This class contains static methods for looking up information about and controlling the run-time data.

Class Variables
loadedLevel

The level index that was last loaded (Read Only).

loadedLevelName

The name of the level that was last loaded (Read Only).

isLoadingLevel

Is some level being loaded? (Read Only)

levelCount

The total number of levels available (Read Only).

streamedBytes

How many bytes have we downloaded from the main unity web stream (Read Only).

isPlaying

Returns true when in any kind of player (Read Only).

isEditor

Are we running inside the Unity editor? (Read Only)

platform

Returns the platform the game is running (Read Only).

runInBackground

Should the player be running when the application is in the background?

dataPath

Contains the path to the game data folder (Read Only).

srcValue

The path to the web player data file relative to the html file (Read Only).

absoluteURL

The absolute path to the web player data file (Read Only).

unityVersion

The version of the Unity runtime used to play the content.

targetFrameRate

Instructs game to try to render at a specified frame rate.

systemLanguage

The language the user's operating system is running in.

backgroundLoadingPriority

Priority of background loading thread.

Class Functions
Quit

Quits the player application. Quit is ignored in the editor or the web player.

CancelQuit

Cancels quitting the application. This is useful for showing a splash screen at the end of a game.

LoadLevel

Loads the level.

LoadLevelAsync

Loads the level asynchronously in the background.

LoadLevelAdditiveAsync

Loads the level additively and asynchronously in the background.

LoadLevelAdditive

Loads a level additively.

GetStreamProgressForLevel

How far has the download progressed? [0...1]

CanStreamedLevelBeLoaded

Can the streamed level be loaded?

CaptureScreenshot

Captures a screenshot at path filename as a PNG file.

ExternalCall

Calls a function in the containing web page (Web Player only).

ExternalEval

Evaluates script snippet in the containing web page (Web Player only).

OpenURL

Opens the url in a browser.

RegisterLogCallback

Register a delegate to be called on log messages.

Delegates
LogCallback

Use this delegate type with RegisterLogCallback to monitor what gets logged.