找回密碼
 注冊帳號

掃一掃,訪問微社區

application.absoluteurl 絕對url

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

摘要: application.absoluteurl 絕對urlstatic varabsoluteurl: stringdescription描述the absolute path to the web player data file (read only).到web播放器數據文件夾的絕對路徑(只讀)。application.absoluteurland ...

application.absoluteurl 絕對url

static varabsoluteurl: string

description描述

the absolute path to the web player data file (read only).

到web播放器數據文件夾的絕對路徑(只讀)。

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");

}

}

文章點評
女校游泳队彩金