找回密碼
 注冊帳號

掃一掃,訪問微社區

application.srcvalue 源文件

2014-12-31 09:14| 發布者: 楊炎| 查看: 1658| 評論: 0|原作者: 蠻牛|來自: unity3d腳本manual

摘要: application.srcvalue 源文件static varsrcvalue: stringdescription描述the path to the web player data file relative to the html file (read only).相對于html文件的web播放器數據文件的路徑(只讀)。actually ...

application.srcvalue 源文件

static varsrcvalue: 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.absoluteurlandapplication.srcvalueallow 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");

}

}

相關閱讀

文章點評
相關文章
女校游泳队彩金