예제 #1
0
        public static void Build(Builder[] builders, SteamBuildUpload steamSettings = null)
        {
            foreach (var item in builders)
            {
                if (string.IsNullOrEmpty(item.buildFolderPath))
                {
                    item.buildFolderPath = EditorUtility.SaveFolderPanel("Select Build Folder", "", "");
                }
            }
            BuildTarget      previousBuildTarget      = EditorUserBuildSettings.activeBuildTarget;
            BuildTargetGroup previousBuildTargetGroup = EditorUserBuildSettings.selectedBuildTargetGroup;

            try{
                foreach (var item in builders)
                {
                    item.Build();
                }
                List <string> buildFolders = new List <string>();
                foreach (var item in builders)
                {
                    if (!buildFolders.Contains(item.buildFolderPath))
                    {
                        buildFolders.Add(item.buildFolderPath);
                        OpenFolder(item.buildFolderPath, item.buildTarget);
                    }
                }
                steamSettings?.UploadToSteam();
            }finally{
                EditorUserBuildSettings.SwitchActiveBuildTarget(previousBuildTargetGroup, previousBuildTarget);
            }
        }
 private void OnEnable()
 {
     b = (SteamBuildUpload)target;
 }