Provides access to application runtime data.
This class contains static methods for looking up information about and controlling the runtime data.
absoluteURL | The URL of the document. For WebGL, this is a web URL. For Android, iOS, or Universal Windows Platform (UWP) this is a deep link URL (Read Only). |
backgroundLoadingPriority | 后台加载线程的优先级。 |
buildGUID | 返回此构建的 GUID(只读)。 |
cloudProjectId | 唯一的云端项目标识符。它对于每个项目而言都是唯一的(只读)。 |
companyName | Returns application company name (Read Only). |
consoleLogPath | 返回控制台日志文件的路径,如果当前平台不支持日志文件,则返回空字符串。 |
dataPath | 包含目标设备上的游戏数据文件夹路径(只读)。 |
exitCancellationToken | Cancellation token raised on exiting Play mode (Editor) or on quitting the application (Read Only). |
genuine | 如果应用程序在构建后以任何方式进行了更改,则返回 false。 |
genuineCheckAvailable | 如果可以确认应用程序完整性,则返回 true。 |
identifier | Returns the application identifier at runtime. |
installerName | 返回安装应用程序的商店或包的名称(只读)。 |
installMode | 返回应用程序安装模式(只读)。 |
internetReachability | Returns the type of internet reachability currently possible on the device. |
isBatchMode | 如果从命令行以 **-batchmode** 标志启动了 Unity,则返回 true(只读)。 |
isConsolePlatform | 当前的运行时平台是否为已知的控制台平台? |
isEditor | Whether the game is running inside the Unity Editor (Read Only). |
isFocused | Whether the Player currently has focus (Read Only). |
isMobilePlatform | Identifies whether the current Runtime platform is a known mobile platform. |
isPlaying | Returns true when called in any kind of built Player, or when called in the Editor in Play mode (Read Only). |
persistentDataPath | Contains the path to a persistent data directory (Read-only). |
platform | 返回游戏运行平台(只读)。 |
productName | 返回应用程序产品名称(只读)。 |
runInBackground | Determines whether the Player should run when the application is in the background |
sandboxType | Returns application running in a sandbox environment (Read-only). |
streamingAssetsPath | The path to the StreamingAssets folder (Read Only). |
systemLanguage | The language in which the user's operating system is running in. |
targetFrameRate | Specifies the target frame rate at which Unity tries to render your game. |
temporaryCachePath | 包含临时数据/缓存目录的路径(只读)。 |
unityVersion | 用于播放内容的 Unity 运行时版本。 |
version | Returns application version number (Read Only). |
CanStreamedLevelBeLoaded | Checks if the streamed level can be loaded. |
GetStackTraceLogType | 获取堆栈跟踪日志记录选项。默认值为 StackTraceLogType.ScriptOnly。 |
HasProLicense | Unity 是否是使用 Pro 许可证激活? |
HasUserAuthorization | Check if the user has authorized use of the webcam or microphone on iOS and WebGL. |
IsPlaying | 如果给定对象是游戏世界的一部分(在任何类型的已构建播放器中或在播放模式中),则返回 true。 |
OpenURL | Opens the URL specified, subject to the permissions and limitations of your app’s current platform and environment. |
Quit | 退出播放器应用程序。 |
RequestAdvertisingIdentifierAsync | Request an advertising ID for iOS and UWP. |
RequestUserAuthorization | Request authorization to use the webcam or microphone on iOS and WebGL. |
SetStackTraceLogType | 设置堆栈跟踪日志记录选项。默认值为 StackTraceLogType.ScriptOnly。 |
Unload | Unloads the Unity Player. |
deepLinkActivated | 如果在 Android、iOS 或通用 Windows 平台 (UWP) 上运行的应用程序是使用深层链接 URL 激活,则会引发此事件。 |
focusChanged | 定义要用于注册在其中获得或失去焦点的事件的委托。 |
logMessageReceived | 收到日志消息时触发的事件。 |
logMessageReceivedThreaded | 收到日志消息时触发的事件。 |
lowMemory | The Application._lowMemory event occurs when your application receives a low-memory notification from the device it is running on. |
memoryUsageChanged | Informs about significant changes in the application's memory usage. |
onBeforeRender | A delegate method used to register for Just Before Render input updates for VR devices. |
quitting | Unity raises this event when the Player application is quitting. |
unloading | Unity raises this event when the Player is unloading. |
wantsToQuit | Unity raises this event when the Player application wants to quit. |
AdvertisingIdentifierCallback | 用于获取广告 ID 的委托方法。 |
LogCallback | 将此委托类型与 Application.logMessageReceived 或 Application.logMessageReceivedThreaded 结合使用来监控记录内容。 |
LowMemoryCallback | 这是移动设备通知内存不足时调用的委托函数。 |
MemoryUsageChangedCallback | A delegate for the Application.memoryUsageChanged vent. |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.