/// <summary> /// Calculate and cache the set of <see cref="BuildTarget" /> based on the target type (Development|Deployment) and /// selected workers. /// </summary> private void CalculateBuildTargets() { if (buildTargets == null) { if (!SpatialOsEditor.WorkerSelection.AnyWorkersSelected) { buildTargets = new List <string>(); } else { var workersToBuild = GetSelectedWorkerNames(); IList <UnityPlayerBuilder> builders; switch (SelectedConfiguration) { case DevelopmentTarget: builders = UnityPlayerBuilders.DevelopmentPlayerBuilders(workersToBuild); break; case DeploymentTarget: builders = UnityPlayerBuilders.DeploymentPlayerBuilders(workersToBuild); break; default: throw new ArgumentOutOfRangeException(string.Format("{0} is an unknown build target.", SelectedConfiguration)); } buildTargets = builders.Select(b => b.BuildTarget.ToString()).Distinct().OrderBy(b => b).ToList(); } } }
private void BuildWorkers() { var workersToBuild = GetSelectedWorkerNames(); var sw = new System.Diagnostics.Stopwatch(); sw.Start(); try { switch (SelectedConfiguration) { case DevelopmentTarget: UnityPlayerBuilders.BuildDevelopmentPlayers(workersToBuild); break; case DeploymentTarget: UnityPlayerBuilders.BuildDeploymentPlayers(workersToBuild); break; default: throw new ArgumentOutOfRangeException(string.Format("{0} is an unknown build target.", SelectedConfiguration)); } } finally { sw.Stop(); } }
public static void ExportDevelopmentEntityPrefabs() { var targets = UnityPlayerBuilders.DevelopmentPlayerBuilders(SimpleBuildSystem.AllWorkerTypes) .Select(b => b.BuildTarget) .Distinct() .ToList(); ExportEntityPrefabs(GetAllPrefabAssetGuids(), targets); }
private static IList <BuildTarget> GetAllBuildTargets() { var allTargets = UnityPlayerBuilders.DeploymentPlayerBuilders(SimpleBuildSystem.AllWorkerTypes) .Union(UnityPlayerBuilders.DevelopmentPlayerBuilders(SimpleBuildSystem.AllWorkerTypes)) .Select(b => b.BuildTarget) .Distinct() .ToList(); // Only export iOS prefabs if building for iOS. if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.iOS) { allTargets.Add(BuildTarget.iOS); } return(allTargets); }
private IList <UnityPlayerBuilder> GetWorkerBuilders() { var workersToBuild = GetSelectedWorkerNames(); switch (SelectedConfiguration) { case DevelopmentTarget: return(UnityPlayerBuilders.DevelopmentPlayerBuilders(workersToBuild)); case DeploymentTarget: return(UnityPlayerBuilders.DeploymentPlayerBuilders(workersToBuild)); default: throw new ArgumentOutOfRangeException(string.Format("{0} is an unknown build target.", SelectedConfiguration)); } }