国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊

發(fā)布構(gòu)建-構(gòu)建播放器管線

2020-11-24 09:54 作者:unity_某某師_高錦錦  | 我要投稿

構(gòu)建播放器管線

在構(gòu)建播放器時(shí),有時(shí)可能希望以某種方式修改構(gòu)建的播放器。例如,可能希望添加自定義圖標(biāo)、在播放器旁邊復(fù)制一些文檔或構(gòu)建安裝程序。您可以通過編輯器腳本實(shí)現(xiàn)此目的,使用?BuildPipeline.BuildPlayer?來運(yùn)行構(gòu)建,接著使用所需的任何后期處理代碼:

// C# 示例。?

using UnityEditor;?

using System.Diagnostics;?

public class ScriptBatch { ? ?

[MenuItem("MyTools/Windows Build With Postprocess")] ? ?

public static void BuildGame (){ ? ? ? ?

// 獲取文件名。 ? ? ? ?

string path = EditorUtility.SaveFolderPanel("Choose Location of Built Game", "", ""); ? ? ? ?

string[] levels = new string[] {"Assets/Scene1.unity", "Assets/Scene2.unity"}; ? // 構(gòu)建播放器。 ? ? ? ?

BuildPipeline.BuildPlayer(levels, path +"/BuiltGame.exe", BuildTarget.StandaloneWindows, BuildOptions.None); ? ? ? ?

// 將文件從項(xiàng)目文件夾復(fù)制到構(gòu)建文件夾,與構(gòu)建的游戲放在一起。 ? ? ? FileUtil.CopyFileOrDirectory("Assets/Templates/Readme.txt", path + "Readme.txt");// 運(yùn)行游戲(System.Diagnostics 中的 Process 類)。 ? ? ? ?Process proc = new Process(); ? ? ? ?

proc.StartInfo.FileName = path +"/BuiltGame.exe"; ? ? ? ?

proc.Start(); } }

PostProcessBuild 屬性

還可以使用?PostProcessBuildAttribute?的 postprocessOrder 參數(shù)來定義構(gòu)建方法的執(zhí)行順序,并使用 Process 類從這些方法調(diào)用外部腳本,如上一部分所示。此參數(shù)用于將構(gòu)建方法從低到高排序,可為其分配任何負(fù)值或正值。


發(fā)布構(gòu)建-構(gòu)建播放器管線的評論 (共 條)

分享到微博請遵守國家法律
井冈山市| 济阳县| 山丹县| 孟州市| 定日县| 绥宁县| 高雄市| 若羌县| 伊宁县| 静宁县| 石屏县| 青铜峡市| 乾安县| 德昌县| 双江| 扶沟县| 磴口县| 朝阳市| 顺平县| 双峰县| 鞍山市| 马关县| 宁蒗| 灵川县| 军事| 福清市| 巨鹿县| 山西省| 仙桃市| 夹江县| 丰原市| 高台县| 宜川县| 汝阳县| 灌南县| 江津市| 隆德县| 栾川县| 隆回县| 宝坻区| 桃园市|