Application应用程序 u3d学习总结笔记本

1.Application属性

2.Application方法

//======================================

1.Application属性

print(Application.companyName);//返回应用程序公司名称(只读)。
print(Application.productName);//返回应用程序产品名称(只读)。
print(Application.installerName);//返回安装该应用程序的商店或包裹的名称(只读)。
print(Application.installMode);//返回应用程序安装模式(只读)。
print(Application.isEditor);//我们是在联合编辑器中运行吗?(只读)

print(Application.isMobilePlatform);//当前的运行时平台是一个已知的移动平台。
print(Application.isPlaying);//在任何类型的播放器中返回true(只读)。
print(Application.isWebPlayer);//我们是否在网络播放器中运行?(只读)
print(Application.platform);//返回游戏正在运行的平台(只读)。
print(Application.unityVersion);//用于播放内容的Unity运行时版本。
print(Application.version);//返回应用程序版本号(只读)。
print(Application.runInBackground);//是否运行在背景
//向游戏目录。
print(Application.dataPath);//包含到游戏数据文件夹的路径(只读)。
print(Application.streamingAssetsPath);//包含通向StreamingAssets文件夹的路径(只读)
		
		
//向系统目录。
print(Application.persistentDataPath);//包含通向持久数据目录的路径(只读)。
print(Application.temporaryCachePath);//在通往临时数据/缓存目录的路径上(只读)。

 

2.Application方法

Application.Quit();//退出游戏

Application.OpenURL("www.baidu.com");//打开网页
Application.CaptureScreenshot(@"D:\1\游戏开发\112.jpg");//游戏截图

UnityEditor.EditorApplication.isPlaying=false;//编辑器状态,退出游戏

猜你喜欢

转载自blog.csdn.net/qq_40346899/article/details/82710355