Unity3D圣典3.3版本-中文版
文集大纲加载中……
本文档使用 MrDoc 发布
-
+
首页
Application.srcValue 源文件
# [Application](Application.html).srcValue 源文件 static var *srcValue* : string *Description* 描述 The path to the web player data file relative to the html file (Read Only). 相对于 html 文件的 web 播放器数据文件的路径(只读)。 Actually this is whatever path is written in the html file as a src parameter to object and embed tags. So if it's the absolute URL,srcValue will have the absolute path. 这是被写到 html 文件中的路径,它是作为 object 的 src 参数和 cmbed 标签。因此如果它是绝对 url,srcvalue 将含有绝对路径。 [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日 23:02
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
关于 MrDoc
觅思文档MrDoc
是
州的先生
开发并开源的在线文档系统,其适合作为个人和小型团队的云笔记、文档和知识库管理工具。
如果觅思文档给你或你的团队带来了帮助,欢迎对作者进行一些打赏捐助,这将有力支持作者持续投入精力更新和维护觅思文档,感谢你的捐助!
>>>捐助鸣谢列表
微信
支付宝
QQ
PayPal
Markdown文件
分享
链接
类型
密码
更新密码