Version: 2017.1

Application

class in UnityEngine

매뉴얼로 전환

설명

Access to application run-time data.

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

정적 변수

absoluteURLThe absolute path to the web player data file (Read Only).
backgroundLoadingPriorityPriority of background loading thread.
buildGUIDReturns a GUID for this build (Read Only).
cloudProjectIdA unique cloud project identifier. It is unique for every project (Read Only).
companyNameReturn application company name (Read Only).
dataPathContains the path to the game data folder (Read Only).
genuineReturns false if application is altered in any way after it was built.
genuineCheckAvailableReturns true if application integrity can be confirmed.
identifierReturns application identifier at runtime. On Apple platforms this is the 'bundleIdentifier' saved in the info.plist file, on Android it's the 'package' from the AndroidManifest.xml.
installerNameReturns the name of the store or package that installed the application (Read Only).
installModeReturns application install mode (Read Only).
internetReachabilityReturns the type of Internet reachability currently possible on the device.
isConsolePlatformIs the current Runtime platform a known console platform.
isEditorAre we running inside the Unity editor? (Read Only)
isFocusedWhether the player currently has focus. Read-only.
isMobilePlatformIs the current Runtime platform a known mobile platform.
isPlayingReturns true when in any kind of player (Read Only).
persistentDataPathContains the path to a persistent data directory (Read Only).
platformReturns the platform the game is running on (Read Only).
productNameReturns application product name (Read Only).
runInBackgroundShould the player be running when the application is in the background?
sandboxTypeReturns application running in sandbox (Read Only).
streamedBytesHow many bytes have we downloaded from the main unity web stream (Read Only).
streamingAssetsPathContains the path to the StreamingAssets folder (Read Only).
systemLanguageThe language the user's operating system is running in.
targetFrameRateInstructs game to try to render at a specified frame rate.
temporaryCachePathContains the path to a temporary data / cache directory (Read Only).
unityVersionThe version of the Unity runtime used to play the content.
versionReturns application version number (Read Only).

정적 함수

CancelQuitCancels quitting the application. This is useful for showing a splash screen at the end of a game.
CanStreamedLevelBeLoadedCan the streamed level be loaded?
GetBuildTagsReturns an array of feature tags in use for this build.
GetStackTraceLogTypeGet stack trace logging options. The default value is StackTraceLogType.ScriptOnly.
GetStreamProgressForLevelHow far has the download progressed? [0...1].
HasProLicenseIs Unity activated with the Pro license?
HasUserAuthorizationCheck if the user has authorized use of the webcam or microphone in the Web Player.
OpenURLOpens the url in a browser.
QuitQuits the player application.
RequestAdvertisingIdentifierAsyncRequest advertising ID for iOS, Android and Windows Store.
RequestUserAuthorizationRequest authorization to use the webcam or microphone in the Web Player.
SetBuildTagsSet an array of feature tags for this build.
SetStackTraceLogTypeSet stack trace logging options. The default value is StackTraceLogType.ScriptOnly.
UnloadUnloads the Unity runtime.

Events

logMessageReceivedEvent that is fired if a log message is received.
logMessageReceivedThreadedEvent that is fired if a log message is received.
lowMemoryThis event occurs when an iOS, Android, or Tizen device notifies of low memory while the app is running in the foreground. You can release non-critical assets from memory (such as, textures or audio clips) in response to this in order to avoid the app being terminated. You can also load smaller versions of such assets. Furthermore, you should serialize any transient data to permanent storage to avoid data loss if the app is terminated.This event corresponds to the following callbacks on the different platforms: - iOS: [UIApplicationDelegate applicationDidReceiveMemoryWarning] - Android: onLowMemory() and onTrimMemory(level == TRIM_MEMORY_RUNNING_CRITICAL) - Tizen: ui_app_add_event_handler with type APP_EVENT_LOW_MEMORYHere is an example of handling the callback:
onBeforeRenderDelegate method used to register for "Just Before Render" input updates for VR devices.

델리게이트

AdvertisingIdentifierCallbackDelegate method for fetching advertising ID.
LogCallbackUse this delegate type with Application.logMessageReceived or Application.logMessageReceivedThreaded to monitor what gets logged.
LowMemoryCallbackThis is the delegate function when a mobile device notifies of low memory.