言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

Application.absoluteURL

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public static var absoluteURL: string;
public static string absoluteURL;
public static absoluteURL as string

Description

Web Player ファイルの絶対パス(RO)

Application.absoluteURLとApplication.srcValueはWebPlayerのデータが移動されたり他のリンクになってリ待った時に検知することが可能です。 データファイルの著作権侵害から守るためにもオススメします。

	// 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");
		}
	}
using UnityEngine;
using System.Collections;

public class ExampleClass : 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");
            
        }
    }
}
import UnityEngine
import System.Collections

public class ExampleClass(MonoBehaviour):

	def Start() as void:
		isPirated as bool = 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')