示例#1
0
        /// <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();
                }
            }
        }
示例#2
0
        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();
            }
        }
示例#3
0
        public static void ExportDevelopmentEntityPrefabs()
        {
            var targets = UnityPlayerBuilders.DevelopmentPlayerBuilders(SimpleBuildSystem.AllWorkerTypes)
                          .Select(b => b.BuildTarget)
                          .Distinct()
                          .ToList();

            ExportEntityPrefabs(GetAllPrefabAssetGuids(), targets);
        }
示例#4
0
        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);
        }
示例#5
0
        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));
            }
        }