Unity Application

整理的一些东西和上网查的一些,以供以后查阅,未完待续

public static NetworkReachability internetReachability { get; }

//Returns the type of Internet reachability currently possible on the device.

//返回目前网络可达在设备上的互联网类型

NotReachable  网络不可达

ReachableViaCarrierDataNetwork  网络通过运营商数据网络是可达的。

ReachableViaLocalAreaNetwork   网络通过WiFi或有线网络是可达的。

public static SystemLanguage systemLanguage { get; }

//The language the user's operating system is running in.

//用户运行的操作系统的语言

Afrikaans = 0,

Arabic = 1,

Basque = 2,

Belarusian = 3,

Bulgarian = 4,

Catalan = 5,

Chinese = 6,

… …

 public static ThreadPriority backgroundLoadingPriority { get; set; }

// Priority of background loading thread.

//后台装载线程优先级

Low = 0,//加载数据速度非常慢,尽量不影响游戏性能的。 在游戏进行时有很好的后台加载。

BelowNormal = 1,

Normal = 2,

High = 4,//装载尽可能多的数据传输速率,因此帧将下降。 加载时显示出良好的快速进度条。

 public static int targetFrameRate { get; set; }

//Instructs game to try to render at a specified frame rate.

//指示游戏试图呈现在一个指定帧率渲染

 

public static string absoluteURL{ get; }

//The absolute path to the web player data file (Read Only).

//web播放器数据文件夹的绝对路径(只读)。

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

}

}

public static string dataPath { get; }

//Contains the path to the game data folder (Read Only).

//包含游戏数据文件夹的路径(只读)。

这个值依赖于运行的平台:

Unity Editor: <path tp project folder>/Assets

Unity 编辑器:<工程文件夹的路径>/Assets

Mac player: <path to player app bundle>/Contents

Mac播放器:<到播放器应用的路径>/Contents

iPhone player: <path to player app bundle>/<AppName.app>/Data

iPhone播放器:<到播放器应用的路径>/<AppName.app>/Data

Win player: <path to executablename_Data folder>

Win播放器:< 包含可执行播发器的文件夹的路径>\Data

Dashboard widget: <path to the dashboard widget bundle>

Dasboard窗口:< dashboard widget bundle的路径>

Web player: The absolute url to the player data file folder (without the actual data file name)

网络播放器:到播放器数据文件夹的绝对路径(没有实际的数据文件名称)

Note that the string returned on a PC will use a forward slash as a folder separator.

值得注意的是如果在PC上使用时需要在每个文件夹前加入斜杠

public static bool genuine { get; }

// Returns false if application is altered in any way after it was built.

检查应用程序是否为正版(非盗版),如果属性的返回值是 false,那么可以通知应用程序的用户,他/她正在使用破解的应用程序,或者可以禁止其访问应用程序上的某些功能.

 

注意: Application.genuineCheckAvailable 应与 Application.genuine 一并使用,以确认应用程序的完整性可得到实际验证。访问 Application.genuine

属性是一项相当昂贵的操作,不应用于帧更新期间或其他时序要求严格的代码。

 

public static bool isEditor { get; }

//Are we running inside the Unity editor? (Read Only)

//是在Unity编辑器内运行?(只读)

if (Application.isEditor)

print("We are running this from inside of the editor!");

public static bool isLoadingLevel { get; }

//Is some level being loaded? (Read Only)

//是否有一些场景正在读取(只读)

方法 LoadLevel LoadLevelAdditive 不会立即生效-一个新的场景在当前游戏帧完成之后被加载。如果一个被请求加载场景的帧已经完成了,那么isLoadingLevel返回值为true

public static void OpenURL(string url);

//Opens the url in a browser.

//在浏览器中打开url

在编辑器或者独立播放器模式下,这将在缺省的浏览器中使用新页打开url 。这将使浏览器位于前端。

但在网页中执行时,包含插件的页将被重定向到 url

posted @ 2015-09-08 13:51  TTT童童童  阅读(462)  评论(0编辑  收藏  举报