public static void Build() { var outputPath = EditorUtility.SaveFolderPanel("Choose Location of Output", "", ""); if (outputPath.Length == 0) { return; } string[] levels = GetLevelsFromBuildSettings(); if (levels.Length == 0) { Debug.Log("Nothing to build."); return; } string targetName = GetBuildTargetName(EditorUserBuildSettings.activeBuildTarget); if (targetName == null) { return; } BuildAssetBundles.Build(); BuildOptions option = EditorUserBuildSettings.development ? BuildOptions.Development : BuildOptions.None; BuildPipeline.BuildPlayer(levels, outputPath + targetName, EditorUserBuildSettings.activeBuildTarget, option); }
static public void RefreshABNames() { try { BuildAssetBundles.RefreshAssetBundleNames(); } catch (System.Exception e) { Debug.LogError(e.ToString()); } }
static public void BuildABWin64() { try { EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Standalone, BuildTarget.StandaloneWindows64); BuildAssetBundles.Build(); } catch (System.Exception e) { Debug.LogError(e.ToString()); } }
static public void BuildABIOS() { try { EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.iOS, BuildTarget.iOS); BuildAssetBundles.Build(); } catch (System.Exception e) { Debug.LogError(e.ToString()); } }