Unity3D圣典3.3版本-中文版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
Application.absoluteURL 绝对 URL
# [Application](Application.html).absoluteURL 绝对 URL static var *absoluteURL* : string *Description* 描述 The absolute path to the web player data file (Read Only). 到 web 播放器数据文件夹的绝对路径(只读)。 [Application.absoluteURL ](Application.absoluteURL.html)and [Application.srcValue ](Application.srcValue.html)allow you to detect if your unityWeb data file was moved to another location or is being linked to. You might want to protect against both to prevent piracy of your data files. Application.absoluteURL 和 Application.srcValue 允许你检测 unityWeb 数据文件是否被移动或链接接到其他位置。你也许想保护这两者来防止盗用数据文件的行为。 * [C#](#) * [JavaScript](#) ``` using UnityEngine; using System.Collections; public class example : MonoBehaviour { void Start() { bool isPirated = false; if (Application.isWebPlayer) { if (Application.srcValue != "game.unity3d") isPirated = true; if (String.Compare(Application.absoluteURL, "http://www.website.com/Game/game.unity3d", true) != 0) isPirated = true; if (isPirated) print("Pirated web player"); } } } ``` ``` // This detects if your data files were moved to another server // 检测你的数据文件是否被移动到其他的服务器 // or are being linked to from somewhere else. // 或是被链接到其他地方 function Start () { var isPirated : boolean = false; if (Application.isWebPlayer) { if (Application.srcValue != "game.unity3d") isPirated = true; if (String.Compare (Application.absoluteURL, "http://www.website.com/Game/game.unity3d", true) != 0) isPirated = true; if (isPirated) print("Pirated web player"); } } ```
da
2022年5月13日 22:56
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码