Exemplo n.º 1
0
    public override IEnumerator Execute(UTContext context)
    {
        var theScene = scene.EvaluateIn(context);

        if (theScene.Contains("*"))
        {
            var finalList = UTFileUtils.CalculateFileset(new string[] { theScene }, new string[0]);
            if (finalList.Length != 1)
            {
                throw new UTFailBuildException("Scene wildcard " + theScene + " yielded " +
                                               finalList.Length + " results but should yield exactly one scene.", this);
            }
            UTFileUtils.FullPathToProjectPath(finalList);
            theScene = finalList[0];
        }

        theScene = UTFileUtils.FullPathToProjectPath(theScene);

        if (UTPreferences.DebugMode)
        {
            Debug.Log("Opening scene: " + theScene, this);
        }
        var result = EditorApplication.OpenScene(theScene);

        if (!result)
        {
            throw new UTFailBuildException("Scene " + theScene + " could not be opened.", this);
        }
        yield return("");
    }
Exemplo n.º 2
0
    public override System.Collections.IEnumerator Execute(UTContext context)
    {
        var theBaseDirectory = baseDirectory.EvaluateIn(context);

        if (string.IsNullOrEmpty(theBaseDirectory))
        {
            theBaseDirectory = UTFileUtils.ProjectAssets;
        }

        if (!Directory.Exists(theBaseDirectory))
        {
            throw new UTFailBuildException("The base directory " + theBaseDirectory + " does not exist.", this);
        }

        theBaseDirectory = UTFileUtils.NormalizeSlashes(theBaseDirectory);
        var theIncludes = EvaluateAll(includes, context);
        var theExcludes = EvaluateAll(excludes, context);

        var theFiles = UTFileUtils.CalculateFileset(theBaseDirectory, theIncludes, theExcludes, UTFileUtils.FileSelectionMode.Files);

        var now = DateTime.Now;

        foreach (var file in theFiles)
        {
            FileInfo src = new FileInfo(file);
            src.LastWriteTime = now;
            yield return("");
        }
    }
Exemplo n.º 3
0
    public override IEnumerator Execute(UTContext context)
    {
        var thePrefab = prefab.EvaluateIn(context);

        if (thePrefab == null)
        {
            throw new UTFailBuildException("You need to specify a prefab to instantiate.", this);
        }

        var theObjectName = objectName.EvaluateIn(context);

        if (UTPreferences.DebugMode)
        {
            Debug.Log("Instantiating prefab: " + thePrefab);
        }

        var theObject = (GameObject)PrefabUtility.InstantiatePrefab(thePrefab);

        if (!string.IsNullOrEmpty(theObjectName))
        {
            theObject.name = theObjectName;
        }


        var theProperty = outputProperty.EvaluateIn(context);

        if (!string.IsNullOrEmpty(theProperty))
        {
            context [theProperty] = theObject;
        }

        yield return("");
    }
Exemplo n.º 4
0
    public override IEnumerator Execute(UTContext context)
    {
        var thePackageToImport = packageToImport.EvaluateIn(context);

        if (string.IsNullOrEmpty(thePackageToImport))
        {
            throw new UTFailBuildException("Package to import must be set", this);
        }

        FileInfo info = new FileInfo(thePackageToImport);

        if (!info.Exists)
        {
            // try to resolve relative to the project root
            info = new FileInfo(Application.dataPath + "\\" + thePackageToImport);
            if (!info.Exists)
            {
                throw new UTFailBuildException("Unable to locate input package " + thePackageToImport, this);
            }
        }
        var doInteractive = interactive.EvaluateIn(context);

        AssetDatabase.ImportPackage(thePackageToImport, doInteractive);
        Debug.Log("Package imported from " + thePackageToImport, this);
        yield return("");
    }
Exemplo n.º 5
0
    public override IEnumerator Execute(UTContext context)
    {
        var debugMode = onlyInDebugMode.EvaluateIn(context);

        if (!debugMode || UTPreferences.DebugMode)
        {
            var evaluatedText = text.EvaluateIn(context);
            Debug.Log(evaluatedText, this);
        }
        yield return("");
    }
Exemplo n.º 6
0
    public override IEnumerator Execute(UTContext context)
    {
        var pathToInstance = assetPath.EvaluateIn(context);

        pathToInstance = UTFileUtils.FullPathToProjectPath(pathToInstance);

        var theAsset = AssetDatabase.LoadMainAssetAtPath(pathToInstance);

        Selection.activeObject = theAsset;

        yield return("");
    }
Exemplo n.º 7
0
    public override IEnumerator Execute(UTContext context)
    {
        string realFolder = folder.EvaluateIn(context);

        try
        {
            System.Diagnostics.Process.Start(new FileInfo(realFolder).Directory.FullName);
        }
        catch (Exception e)
        {
            throw new UTFailBuildException("Opening folder failed. " + e.Message, this);
        }

        yield return("");
    }
    private UTFilter GetByExpressionFilter(UTContext context)
    {
        if (expressions.Length == 0)
        {
            throw new UTFailBuildException("You need to specify at least one expression to search for.", this);
        }

        string gameObjectProperty = currentGameObjectProperty.EvaluateIn(context);

        if (string.IsNullOrEmpty(gameObjectProperty))
        {
            throw new UTFailBuildException("You need to specify the name of the game object property.", this);
        }
        return(new UTExpressionFilter(EvaluateAll(expressions, context), gameObjectProperty, context));
    }
    public override IEnumerator Execute(UTContext context)
    {
        if (startOfSubtree == null)
        {
            Debug.LogWarning("No subtree specified.");
            yield break;
        }

        var theItemsPropertyName = itemsPropertyName.EvaluateIn(context);

        if (string.IsNullOrEmpty(theItemsPropertyName))
        {
            throw new UTFailBuildException("You need to specify the name of the property which holds the list of items.", this);
        }

        var items = context[theItemsPropertyName];

        var theItemPropertyName = itemPropertyName.EvaluateIn(context);

        if (string.IsNullOrEmpty(theItemsPropertyName))
        {
            throw new UTFailBuildException("You need to specify the name of the property which holds the current item.", this);
        }

        var theIndexPropertyName = indexPropertyName.EvaluateIn(context);
        var indexPropertySet     = !string.IsNullOrEmpty(theIndexPropertyName);

        var index = 0;

        if (items is IEnumerable)
        {
            foreach (var item in (IEnumerable)items)
            {
                context[theItemPropertyName] = item;
                if (indexPropertySet)
                {
                    context[theIndexPropertyName] = index;
                }
                var enumerator = UTAutomationPlan.ExecutePath(startOfSubtree, context);
                do
                {
                    yield return("");
                }while (enumerator.MoveNext());
                index++;
            }
        }
    }
    public override IEnumerator Execute(UTContext context)
    {
        if (UTPreferences.DebugMode)
        {
            Debug.Log("Modifying cross platform player settings.", this);
        }

        PlayerSettings.companyName = companyName.EvaluateIn(context);
        PlayerSettings.productName = productName.EvaluateIn(context);
        PlayerSettings.SetIconsForTargetGroup(BuildTargetGroup.Unknown, new Texture2D[] { defaultIcon.EvaluateIn(context) });
        if (UTPreferences.DebugMode)
        {
            Debug.Log("Cross platform player settings modified.", this);
        }

        yield return("");
    }
Exemplo n.º 11
0
    public override IEnumerator Execute(UTContext context)
    {
        if (startOfSubtree == null)
        {
            Debug.LogWarning("No subtree specified.");
            yield break;
        }

        UTFileUtils.FileSelectionMode theMode = UTFileUtils.FileSelectionMode.Files;
        if (selectionMode != null)           // can happen when we migrate older automation plans which didn't have this setting.
        {
            theMode = selectionMode.EvaluateIn(context);
        }

        var theFilePropertyName = filePropertyName.EvaluateIn(context);

        if (string.IsNullOrEmpty(theFilePropertyName))
        {
            throw new UTFailBuildException("You need to specify the property which holds the current file.", this);
        }

        var theIncludes = UTAction.EvaluateAll(includes, context);
        var theExcludes = UTAction.EvaluateAll(excludes, context);

        var files = UTFileUtils.CalculateFileset(theIncludes, theExcludes, theMode);

        var theIndexPropertyName = indexPropertyName.EvaluateIn(context);
        var indexPropertySet     = !string.IsNullOrEmpty(theIndexPropertyName);

        var index = 0;

        foreach (var file in files)
        {
            context [theFilePropertyName] = file;
            if (indexPropertySet)
            {
                context [theIndexPropertyName] = index;
            }
            var enumerator = UTAutomationPlan.ExecutePath(startOfSubtree, context);
            do
            {
                yield return("");
            } while (enumerator.MoveNext());
            index++;
        }
    }
    public override IEnumerator Execute(UTContext context)
    {
        var theGameObject = gameObject.EvaluateIn(context);

        if (theGameObject == null)
        {
            throw new UTFailBuildException("You need to specify a game object to rename.", this);
        }

        var theName = newName.EvaluateIn(context);

        if (string.IsNullOrEmpty(theName))
        {
            throw new UTFailBuildException("You need to specify a new name for the game object.", this);
        }

        theGameObject.name = theName;
        yield return("");
    }
Exemplo n.º 13
0
    public override IEnumerator Execute(UTContext context)
    {
        var theInputFileName = inputFileName.EvaluateIn(context);

        if (!File.Exists(theInputFileName))
        {
            throw new UTFailBuildException("The input file " + theInputFileName + " does not exist.", this);
        }

        var theOutputFolder = outputFolder.EvaluateIn(context);

        if (string.IsNullOrEmpty(theOutputFolder))
        {
            throw new UTFailBuildException("You need to specify an output folder.", this);
        }

        if (File.Exists(theOutputFolder))
        {
            throw new UTFailBuildException("The output folder " + theOutputFolder + " is a file.", this);
        }

        if (!Directory.Exists(theOutputFolder))
        {
            Directory.CreateDirectory(theOutputFolder);
        }

        var doOverwrite = overwriteExistingFiles.EvaluateIn(context);

        using (ZipFile zip = ZipFile.Read(theInputFileName)) {
            foreach (ZipEntry e in zip)
            {
                if (UTPreferences.DebugMode)
                {
                    Debug.Log("Extracting " + e.FileName, this);
                }
                e.Extract(theOutputFolder, doOverwrite ? ExtractExistingFileAction.OverwriteSilently : ExtractExistingFileAction.DoNotOverwrite);
                yield return("");
            }
        }

        Debug.Log("ZIP at " + theInputFileName + " extracted to " + theOutputFolder, this);
        yield return("");
    }
Exemplo n.º 14
0
    public override IEnumerator Execute(UTContext context)
    {
        var theName = propertyName.EvaluateIn(context);

        if (string.IsNullOrEmpty(theName))
        {
            throw new UTFailBuildException("The name of the property must not be empty.", this);
        }

        // get the asset
        var pathToInstance = assetPath.EvaluateIn(context);

        pathToInstance = UTFileUtils.FullPathToProjectPath(pathToInstance);

        var theAsset = AssetDatabase.LoadMainAssetAtPath(pathToInstance);


        yield return("");
    }
Exemplo n.º 15
0
    public override IEnumerator Execute(UTContext context)
    {
        var theName = propertyName.EvaluateIn(context);

        if (string.IsNullOrEmpty(theName))
        {
            throw new UTFailBuildException("The name of the property must not be empty.", this);
        }

        object theRealValue = propertyValue.Value;

        if (propertyValue.UseExpression)
        {
            theRealValue = context.Evaluate(propertyValue.Expression);
        }

        var doSetOnlyIfUnset = onlyIfUnset.EvaluateIn(context);

        if (!doSetOnlyIfUnset || !context.ContainsProperty(theName))
        {
            if (UTPreferences.DebugMode)
            {
                Type valueType = theRealValue != null?theRealValue.GetType() : null;

                Debug.Log("Setting property '" + theName + "' to " +
                          (valueType != null ? "[" + valueType.Name + "] " : "") + theRealValue, this);
            }
            context [theName] = theRealValue;
        }
        else
        {
            if (doSetOnlyIfUnset)
            {
                if (UTPreferences.DebugMode)
                {
                    Debug.Log("Not setting property '" + theName + "' because it is already set.");
                }
            }
        }
        yield return("");
    }
Exemplo n.º 16
0
    public override IEnumerator Execute(UTContext context)
    {
        var theScene = scene.EvaluateIn(context);

        if (string.IsNullOrEmpty(theScene))
        {
            throw new UTFailBuildException("You need to specify a path where the scene should be saved to.", this);
        }
        theScene = UTFileUtils.FullPathToProjectPath(theScene);

        var theFullPath = UTFileUtils.CombineToPath(UTFileUtils.ProjectRoot, theScene);

        if (File.Exists(theFullPath))
        {
            throw new UTFailBuildException("There is already a file at '" + theScene + "'.", this);
        }

        UTFileUtils.EnsureParentFolderExists(theFullPath);
        EditorApplication.NewScene();
        EditorApplication.SaveScene(theScene, false);
        yield return("");
    }
Exemplo n.º 17
0
    public override IEnumerator Execute(UTContext context)
    {
        var isSaveCopy  = saveCopy.EvaluateIn(context);
        var theFileName = "";

        if (isSaveCopy)
        {
            theFileName = filename.EvaluateIn(context);
            if (string.IsNullOrEmpty(theFileName))
            {
                throw new UTFailBuildException("You need to specify a file name when saving a copy of a scene.", this);
            }
            theFileName = UTFileUtils.FullPathToProjectPath(theFileName);

            UTFileUtils.EnsureParentFolderExists(UTFileUtils.CombineToPath(UTFileUtils.ProjectRoot, theFileName));
        }
        if (!EditorApplication.SaveScene(theFileName, isSaveCopy))
        {
            throw new UTFailBuildException("Saving the scene failed.", this);
        }
        yield return("");
    }
Exemplo n.º 18
0
    public override IEnumerator Execute(UTContext context)
    {
        var theMessage = messageOnFail.EvaluateIn(context);

        foreach (var condition in conditions)
        {
            if (UTPreferences.DebugMode)
            {
                if (condition.UseExpression)
                {
                    Debug.Log("Evaluating expression " + condition.Expression);
                }
            }

            var result = condition.EvaluateIn(context);
            if (result == false)
            {
                if (UTPreferences.DebugMode)
                {
                    Debug.Log("Condition was not true. Aborting.");
                }
                if (!string.IsNullOrEmpty(theMessage))
                {
                    Debug.LogError(theMessage);
                }
                throw new UTFailBuildException("Assertion failed. Aborting plan execution.", this);
            }
            else
            {
                if (UTPreferences.DebugMode)
                {
                    Debug.Log("Condition was true. Continuing.");
                }
            }
        }

        yield return("");
    }
Exemplo n.º 19
0
    public override IEnumerator Execute(UTContext context)
    {
        context["wp8ResVersion"] = wp8ResVersion.EvaluateIn(context);
        context["wp8ShrinkRes"]  = wp8shrink.EvaluateIn(context);
        string path             = wp8shrink.Value ? BundleManager.WP8LOWQuality : BundleManager.WP8NormalQuality;
        string remoteoutputPath = BundleManager.WP8UpdateOutputPath + path;

//        if (wp8shrink.Value)
//        {
//            CommandBuild.BuildWP8UpdateRes_Low();
//        }
//        else
//        {
//            CommandBuild.BuildWP8UpdateRes_Normal();
//        }
        string resourceVersion      = context["wp8ResVersion"] as string;
        string remoteResVersionPath = remoteoutputPath + "/../" + UpdateHelper.VersionFileName;
        string localResVersionPath  = BundleManager.WP8OutputPath + path + UpdateHelper.AppVersionFolder + "/" + UpdateHelper.VersionFileName;

        Utils.WriteStringToFile(remoteResVersionPath, resourceVersion);
        Utils.WriteStringToFile(localResVersionPath, resourceVersion);

        yield return("");
    }
    public override IEnumerator Execute(UTContext context)
    {
        if (UTPreferences.DebugMode)
        {
            Debug.Log("Modifying Android player settings.", this);
        }
        var theBundleIdentifier = bundleIdentifier.EvaluateIn(context);

        if (string.IsNullOrEmpty(theBundleIdentifier))
        {
            throw new UTFailBuildException("You need to specify the bundle identifier.", this);
        }

        var theBundleVersion = bundleVersion.EvaluateIn(context);

        if (string.IsNullOrEmpty(theBundleVersion))
        {
            throw new UTFailBuildException("You need to specify the bundle version.", this);
        }

        var theKeyStore = keyStore.EvaluateIn(context);

        if (!string.IsNullOrEmpty(theKeyStore) && !File.Exists(theKeyStore))
        {
            throw new UTFailBuildException("The specified keystore does not exist.", this);
        }

        PlayerSettings.defaultInterfaceOrientation            = defaultOrientation.EvaluateIn(context);
        PlayerSettings.statusBarHidden                        = statusBarHidden.EvaluateIn(context);
        PlayerSettings.use32BitDisplayBuffer                  = use32BitDisplayBuffer.EvaluateIn(context);
        PlayerSettings.Android.use24BitDepthBuffer            = use24BitDepthBuffer.EvaluateIn(context);
        PlayerSettings.Android.showActivityIndicatorOnLoading = showActivityIndicatorOnLoading.EvaluateIn(context);

        UTPlayerSettingsExt extPlayerSettings = new UTPlayerSettingsExt();

        extPlayerSettings.MobileSplashScreen = mobileSplashScreen.EvaluateIn(context);
        extPlayerSettings.Apply();
        PlayerSettings.Android.splashScreenScale = splashScaling.EvaluateIn(context);

        PlayerSettings.bundleIdentifier          = theBundleIdentifier;
        PlayerSettings.bundleVersion             = theBundleVersion;
        PlayerSettings.Android.bundleVersionCode = bundleVersionCode.EvaluateIn(context);
        PlayerSettings.Android.minSdkVersion     = minimumApiLevel.EvaluateIn(context);

        PlayerSettings.Android.targetDevice = targetDevice.EvaluateIn(context);
#if UNITY_3_5
        PlayerSettings.Android.targetGraphics = targetGraphics.EvaluateIn(context);
#endif
#if !UNITY_3_5
        PlayerSettings.targetGlesGraphics = targetGlesGraphics.EvaluateIn(context);
#endif
        PlayerSettings.Android.preferredInstallLocation = installLocation.EvaluateIn(context);
        PlayerSettings.Android.forceInternetPermission  = forceInternetPermission.EvaluateIn(context);
        PlayerSettings.Android.forceSDCardPermission    = forceSDCardPermission.EvaluateIn(context);

        PlayerSettings.apiCompatibilityLevel     = apiCompatibilityLevel.EvaluateIn(context);
        PlayerSettings.stripUnusedMeshComponents = optimizeMeshData.EvaluateIn(context);
#if UNITY_3_5
        PlayerSettings.debugUnloadMode = debugUnloadMode.EvaluateIn(context);
#endif

        PlayerSettings.Android.keystoreName = theKeyStore;
        PlayerSettings.Android.keystorePass = keyStorePassword.EvaluateIn(context);

        PlayerSettings.Android.keyaliasName = keyAlias.EvaluateIn(context);
        PlayerSettings.Android.keyaliasPass = keyPassword.EvaluateIn(context);

        if (UTPreferences.DebugMode)
        {
            Debug.Log("Android player settings modified.", this);
        }

        yield return("");
    }
Exemplo n.º 21
0
    public override System.Collections.IEnumerator Execute(UTContext context)
    {
        var theFirstListProperty = firstListProperty.EvaluateIn(context);

        if (string.IsNullOrEmpty(theFirstListProperty))
        {
            throw new UTFailBuildException("You must specify the property holding the first list.", this);
        }

        var theSecondListProperty = secondListProperty.EvaluateIn(context);

        if (string.IsNullOrEmpty(theFirstListProperty))
        {
            throw new UTFailBuildException("You must specify the property holding the second list.", this);
        }

        var theOutputProperty = outputProperty.EvaluateIn(context);

        if (string.IsNullOrEmpty(theFirstListProperty))
        {
            throw new UTFailBuildException("You must specify the output property.", this);
        }

        var firstEnumerable = context [theFirstListProperty];

        if (!(firstEnumerable is IEnumerable))
        {
            if (firstEnumerable == null)
            {
                throw new UTFailBuildException("Property '" + theFirstListProperty + "' has a null value. Cannot combine this.", this);
            }
            throw new UTFailBuildException("Property '" + theFirstListProperty + "' is of type '" + firstEnumerable.GetType() + "'. Cannot combine this.", this);
        }

        var secondEnumerable = context [theSecondListProperty];

        if (!(secondEnumerable is IEnumerable))
        {
            if (secondEnumerable == null)
            {
                throw new UTFailBuildException("Property '" + theSecondListProperty + "' has a null value. Cannot combine this.", this);
            }
            throw new UTFailBuildException("Property '" + theSecondListProperty + "' is of type '" + secondEnumerable.GetType() + "'. Cannot combine this.", this);
        }

        var firstListAsSet = new HashSet <object> ();

        foreach (var obj in (IEnumerable)firstEnumerable)
        {
            firstListAsSet.Add(obj);
        }

        var secondListAsSet = new HashSet <object> ();

        foreach (var obj in (IEnumerable)secondEnumerable)
        {
            secondListAsSet.Add(obj);
        }

        var theListOperationType = listOperationType.EvaluateIn(context);

        switch (theListOperationType)
        {
        case UTCombineListOperation.Union:
            firstListAsSet.UnionWith(secondListAsSet);
            break;

        case UTCombineListOperation.Intersect:
            firstListAsSet.IntersectWith(secondListAsSet);
            break;

        case UTCombineListOperation.Subtract:
            firstListAsSet.ExceptWith(secondListAsSet);
            break;

        case UTCombineListOperation.ExclusiveOr:
            firstListAsSet.SymmetricExceptWith(secondListAsSet);
            break;
        }

        context [theOutputProperty] = firstListAsSet;

        yield return("");
    }
    /// <summary>
    /// Invokes the program.
    /// </summary>
    /// <param name='executable'>
    /// Executable to invoke.
    /// </param>
    /// <param name='context'>
    /// The context. Parameters will be calculated using the context.
    /// </param>
    /// <exception cref='UTFailBuildException'>
    /// Is thrown when the program cannot be started.
    /// </exception>
    private void InvokeProgram(string executable, UTContext context)
    {
        var args = EvaluateAll(arguments, context);

        string finalArgs = string.Join(" ", args);

        if (finalArgs.Contains(Marker))
        {
            throw new UTFailBuildException("You cannot use $me.File() outside of $me.Repeat(). Please check your parameters.", this);
        }

        var doUseShellExecute = useShellExecute.EvaluateIn(context);

        var theWorkingDirectory = workingDirectory.EvaluateIn(context);

        if (!string.IsNullOrEmpty(theWorkingDirectory))
        {
            if (!Directory.Exists(theWorkingDirectory))
            {
                throw new UTFailBuildException("Working directory " + theWorkingDirectory + " does not exist.", this);
            }
        }

        Process process = new Process();

        process.StartInfo.FileName        = executable;
        process.StartInfo.Arguments       = finalArgs;
        process.StartInfo.UseShellExecute = doUseShellExecute;

        if (!string.IsNullOrEmpty(theWorkingDirectory))
        {
            process.StartInfo.WorkingDirectory = theWorkingDirectory;
        }

        if (!doUseShellExecute)
        {
            if (UTPreferences.DebugMode)
            {
                process.StartInfo.RedirectStandardOutput = true;
                process.StartInfo.RedirectStandardError  = true;
                process.OutputDataReceived += (sender, argv) => UDebug.Log("[Execute]" + argv.Data);
                process.ErrorDataReceived  += (sender, argv) => UDebug.LogWarning("[Execute]" + argv.Data);
            }
        }

        try {
            UDebug.Log("Starting process " + executable);
            if (UTPreferences.DebugMode)
            {
                UDebug.Log("Args: " + finalArgs);
            }

            process.Start();
            if (!doUseShellExecute && UTPreferences.DebugMode)
            {
                process.BeginOutputReadLine();
            }
            currentProcess = process;
        } catch (Win32Exception e) {
            throw new UTFailBuildException("Couldn't start process: " + e.Message, this);
        }
    }
Exemplo n.º 23
0
    public override IEnumerator Execute(UTContext context)
    {
        var theBaseDirectory = baseDirectory.EvaluateIn(context);

        if (string.IsNullOrEmpty(theBaseDirectory))
        {
            theBaseDirectory = UTFileUtils.ProjectAssets;
        }

        var theOutputFileName = outputFileName.EvaluateIn(context);

        if (string.IsNullOrEmpty(theOutputFileName))
        {
            throw new UTFailBuildException("Output file name must be set", this);
        }


        if (!theOutputFileName.EndsWith(".zip"))
        {
            Debug.LogWarning("Output filename should end with .zip.", this);
        }

        if (!appendToExistingFile.EvaluateIn(context))
        {
            if (File.Exists(theOutputFileName))
            {
                if (UTPreferences.DebugMode)
                {
                    Debug.Log("Deleting existing ZIP file: " + theOutputFileName);
                }
                File.Delete(theOutputFileName);
            }
        }

        var theIncludes = EvaluateAll(includes, context);
        var theExcludes = EvaluateAll(excludes, context);

        var fileList = UTFileUtils.CalculateFileset(theBaseDirectory, theIncludes, theExcludes, UTFileUtils.FileSelectionMode.Files);

        if (fileList.Length == 0)
        {
            throw new UTFailBuildException("There is nothing to ZIP.", this);
        }

        Debug.Log("Zipping " + fileList.Length + " files.", this);

        UTFileUtils.EnsureParentFolderExists(theOutputFileName);

        var doFlatten = flattenStructure.EvaluateIn(context);
        var theBaseFolderInZipFile = baseFolderInZIPFile.EvaluateIn(context);

        using (ZipFile zf = new ZipFile(theOutputFileName)) {
            foreach (var file in fileList)
            {
                if (UTPreferences.DebugMode)
                {
                    Debug.Log("Zipping: " + file, this);
                }
                if (doFlatten)
                {
                    zf.AddFile(file, theBaseFolderInZipFile);
                }
                else
                {
                    var relativePath = UTFileUtils.StripBasePath(UTFileUtils.GetParentPath(file), theBaseDirectory);
                    zf.AddFile(file, UTFileUtils.CombineToPath(theBaseFolderInZipFile, relativePath));
                }
                yield return("");
            }
            zf.Save();
        }

        Debug.Log("ZIP file created at " + theOutputFileName, this);
        yield return("");
    }
Exemplo n.º 24
0
    public override IEnumerator Execute(UTContext context)
    {
        if (UTPreferences.DebugMode)
        {
            Debug.Log("Modifying iOS player settings.", this);
        }
        var theBundleIdentifier = bundleIdentifier.EvaluateIn(context);

        if (string.IsNullOrEmpty(theBundleIdentifier))
        {
            throw new UTFailBuildException("You need to specify the bundle identifier.", this);
        }

        var theBundleVersion = bundleVersion.EvaluateIn(context);

        if (string.IsNullOrEmpty(theBundleVersion))
        {
            throw new UTFailBuildException("You need to specify the bundle version.", this);
        }

        var theFrequency = accelerometerFrequency.EvaluateIn(context);

        if (theFrequency != 0 && theFrequency != 15 && theFrequency != 30 && theFrequency != 60 && theFrequency != 100)
        {
            throw new UTFailBuildException("Invalid accelerometer frequency. Valid values for accelerometer frequencies are 0, 15, 30, 60 and 100.", this);
        }

        PlayerSettings.defaultInterfaceOrientation        = defaultOrientation.EvaluateIn(context);
        PlayerSettings.statusBarHidden                    = statusBarHidden.EvaluateIn(context);
        PlayerSettings.iOS.statusBarStyle                 = statusBarStyle.EvaluateIn(context);
        PlayerSettings.use32BitDisplayBuffer              = use32BitDisplayBuffer.EvaluateIn(context);
        PlayerSettings.iOS.showActivityIndicatorOnLoading = showActivityIndicatorOnLoading.EvaluateIn(context);

        UTPlayerSettingsExt extSettings = new UTPlayerSettingsExt();

        extSettings.MobileSplashScreen               = mobileSplashScreen.EvaluateIn(context);
        extSettings.IPhoneHighResSplashScreen        = highResIphone.EvaluateIn(context);
        extSettings.IPhoneTallHighResSplashScreen    = highResIphoneTall.EvaluateIn(context);
        extSettings.IPadPortraitSplashScreen         = iPadPortrait.EvaluateIn(context);
        extSettings.IPadLandscapeSplashScreen        = iPadLandscape.EvaluateIn(context);
        extSettings.IPadHighResPortraitSplashScreen  = highResIpadPortrait.EvaluateIn(context);
        extSettings.IPadHighResLandscapeSplashScreen = highResIpadLandscape.EvaluateIn(context);
        extSettings.Apply();

        PlayerSettings.iOS.prerenderedIcon = prerenderedIcon.EvaluateIn(context);


        PlayerSettings.bundleIdentifier = theBundleIdentifier;
        PlayerSettings.bundleVersion    = theBundleVersion;

        PlayerSettings.iOS.targetDevice = targetDevice.EvaluateIn(context);
#if UNITY_3_5
        PlayerSettings.iOS.targetPlatform = targetPlatform.EvaluateIn(context);
#endif
#if !UNITY_3_5
        PlayerSettings.targetGlesGraphics = targetGlesGraphics.EvaluateIn(context);
#endif
        //PlayerSettings.iOS.targetResolution = targetResolution.EvaluateIn (context);
        PlayerSettings.accelerometerFrequency     = theFrequency;
        PlayerSettings.iOS.requiresPersistentWiFi = requiresPersistentWifi.EvaluateIn(context);
        PlayerSettings.iOS.exitOnSuspend          = exitOnSuspend.EvaluateIn(context);

        PlayerSettings.apiCompatibilityLevel      = apiCompatibilityLevel.EvaluateIn(context);
        PlayerSettings.aotOptions                 = aotCompilationOptions.EvaluateIn(context);
        PlayerSettings.iOS.sdkVersion             = sdkVersion.EvaluateIn(context);
        PlayerSettings.iOS.targetOSVersion        = targetOsVersion.EvaluateIn(context);
        PlayerSettings.iOS.scriptCallOptimization = scriptCallOptimizationLevel.EvaluateIn(context);
        PlayerSettings.stripUnusedMeshComponents  = optimizeMeshData.EvaluateIn(context);
#if UNITY_3_5
        PlayerSettings.debugUnloadMode = debugUnloadMode.EvaluateIn(context);
#endif

        if (UTPreferences.DebugMode)
        {
            Debug.Log("iOS player settings modified.", this);
        }

        yield return("");
    }
    public override IEnumerator Execute(UTContext context)
    {
        var theExecutable = pathToExecutable.EvaluateIn(context);

        if (!System.IO.File.Exists(theExecutable))
        {
            throw new UTFailBuildException("Executable " + theExecutable + " does not exist.", this);
        }

        string[] finalFileSet;
        if (useFileset.EvaluateIn(context))
        {
            var theBasePath = basePath.EvaluateIn(context);
            if (!Directory.Exists(theBasePath))
            {
                throw new UTFailBuildException("The base path " + theBasePath + " does not exist.", this);
            }

            var theIncludes = EvaluateAll(includes, context);
            var theExcludes = EvaluateAll(excludes, context);

            var theFiles = UTFileUtils.CalculateFileset(theBasePath, theIncludes, theExcludes, UTFileUtils.FileSelectionMode.Files);

            if (relativePaths.EvaluateIn(context))
            {
                UTFileUtils.StripBasePath(theFiles, theBasePath);
            }

            if (pathSeparator.EvaluateIn(context) == PathSeparator.Windows)
            {
                UTFileUtils.SlashesToWindowsSlashes(theFiles);
            }

            finalFileSet = theFiles;
        }
        else
        {
            finalFileSet = new string[0];
        }


        if (runOncePerFile.EvaluateIn(context))
        {
            foreach (var file in finalFileSet)
            {
                if (context.CancelRequested)
                {
                    break;
                }

                currentFiles = new string[] { file };
                InvokeProgram(theExecutable, context);
                do
                {
                    yield return("");

                    if (context.CancelRequested && !currentProcess.HasExited)
                    {
                        currentProcess.Kill();
                        break;
                    }
                } while (!currentProcess.HasExited);

                CheckResult(context);
            }
        }
        else
        {
            currentFiles = finalFileSet;
            InvokeProgram(theExecutable, context);
            do
            {
                yield return("");

                if (context.CancelRequested && !currentProcess.HasExited)
                {
                    currentProcess.Kill();
                }
            } while(!currentProcess.HasExited);

            CheckResult(context);
        }
    }
    public override IEnumerator Execute(UTContext context)
    {
        var theGameObject = gameObject.EvaluateIn(context);

        if (theGameObject == null)
        {
            throw new UTFailBuildException("You must specify the game object htat holds the component.", this);
        }

        var theProperty = property.EvaluateIn(context);

        if (theProperty == null || !theProperty.FullyDefined)
        {
            throw new UTFailBuildException("You must specify the component type and its property you want to change.", this);
        }

        var propertyPath = UTComponentScanner.FindPropertyPath(theProperty.Type, theProperty.FieldPath);

        if (propertyPath == null)
        {
            throw new UTFailBuildException("The component type or the property path is no longer valid.", this);
        }

        var theComponent = theGameObject.GetComponent(theProperty.Type);

        if (theComponent == null)
        {
            // nothing to do
            if (UTPreferences.DebugMode)
            {
                Debug.Log("Component " + theProperty.Type.Name + " not found at game object " + theGameObject, this);
            }
        }
        else
        {
            Type   propertyType = UTInternalCall.GetMemberType(propertyPath[propertyPath.Length - 1]);
            object propertyValue;
            if (typeof(string).IsAssignableFrom(propertyType))
            {
                propertyValue = stringPropertyValue.EvaluateIn(context);
            }
            else if (typeof(bool).IsAssignableFrom(propertyType))
            {
                propertyValue = boolPropertyValue.EvaluateIn(context);
            }
            else if (typeof(int).IsAssignableFrom(propertyType))
            {
                propertyValue = intPropertyValue.EvaluateIn(context);
            }
            else if (typeof(float).IsAssignableFrom(propertyType))
            {
                propertyValue = floatPropertyValue.EvaluateIn(context);
            }
            else if (typeof(Texture).IsAssignableFrom(propertyType))
            {
                propertyValue = texturePropertyValue.EvaluateIn(context);
            }
            else if (typeof(Vector3).IsAssignableFrom(propertyType))
            {
                propertyValue = vector3PropertyValue.EvaluateIn(context);
            }
            else if (typeof(Vector2).IsAssignableFrom(propertyType))
            {
                propertyValue = vector2PropertyValue.EvaluateIn(context);
            }
            else if (typeof(Rect).IsAssignableFrom(propertyType))
            {
                propertyValue = rectPropertyValue.EvaluateIn(context);
            }
            else if (typeof(Quaternion).IsAssignableFrom(propertyType))
            {
                propertyValue = quaternionPropertyValue.EvaluateIn(context);
            }
            else if (typeof(Material).IsAssignableFrom(propertyType))
            {
                propertyValue = materialPropertyValue.EvaluateIn(context);
            }
            else if (typeof(Color).IsAssignableFrom(propertyType))
            {
                propertyValue = colorPropertyValue.EvaluateIn(context);
            }
            else if (typeof(GameObject).IsAssignableFrom(propertyType))
            {
                propertyValue = gameObjectPropertyValue.EvaluateIn(context);
            }
            else if (typeof(UObject).IsAssignableFrom(propertyType))
            {
                propertyValue = unityObjectPropertyValue.EvaluateIn(context);
            }
            else
            {
                propertyValue = objectPropertyValue.EvaluateIn(context);
            }

            // TODO: we need a lot more validation here.
            // e.g. is the value assignable?

            // Tested with Vector3 -> BoxCollider:center
            // and float -> BoxCollider:center.y
            UTInternalCall.SetMemberValue(theComponent, propertyPath, propertyValue);
        }
        yield return("");
    }
Exemplo n.º 27
0
    public override IEnumerator Execute(UTContext context)
    {
        var theOutputFile = outputFileName.EvaluateIn(context);

        if (string.IsNullOrEmpty(theOutputFile))
        {
            throw new UTFailBuildException("You must specify an output file name.", this);
        }

        var theBundleType = bundleType.EvaluateIn(context);

        var theFiles = new string[0];

        if (theBundleType == UTTypeOfBundle.SimpleAssetBundle || !useScenesFromBuildSettings.EvaluateIn(context))
        {
            var theIncludes = EvaluateAll(includes, context);
            var theExcludes = EvaluateAll(excludes, context);
            theFiles = UTFileUtils.CalculateFileset(theIncludes, theExcludes);

            UTFileUtils.FullPathToProjectPath(theFiles);
        }
        else
        {
            var scenes = EditorBuildSettings.scenes;
            theFiles = Array.ConvertAll <EditorBuildSettingsScene, string> (scenes, scene => scene.path);
        }

        if (UTPreferences.DebugMode)
        {
            foreach (var file in theFiles)
            {
                Debug.Log("Including: " + file, this);
            }
        }
        Debug.Log("Including " + theFiles.Length + " assets/scenes.");

        if (theBundleType == UTTypeOfBundle.StreamedScenes && theFiles.Length == 0)
        {
            throw new UTFailBuildException("No scenes have been selected. Unable to build a streamed scenes asset bundle with no scenes.", this);
        }

        var     theMainAsset  = "";
        UObject realMainAsset = null;

        UObject[] realAssets = null;

        if (theBundleType == UTTypeOfBundle.SimpleAssetBundle)
        {
            theMainAsset = mainAsset.EvaluateIn(context);
            if (!String.IsNullOrEmpty(theMainAsset))
            {
                if (theMainAsset.Contains("*"))
                {
                    var finalList = UTFileUtils.CalculateFileset(new string[] { theMainAsset }, new string[0]);
                    if (finalList.Length != 1)
                    {
                        throw new UTFailBuildException("Main asset wildcard " + theMainAsset + " yielded " +
                                                       finalList.Length + " results but should yield exactly one asset.", this);
                    }
                    theMainAsset = UTFileUtils.FullPathToProjectPath(finalList [0]);
                }

                // now get the real objects for the paths
                realMainAsset = AssetDatabase.LoadMainAssetAtPath(theMainAsset);

                if (realMainAsset == null)
                {
                    throw new UTFailBuildException("Unable to load the main asset " + theMainAsset + " from asset database.", this);
                }
            }

            realAssets = Array.ConvertAll <string, UObject> (theFiles, file => {
                var result = AssetDatabase.LoadMainAssetAtPath(file);
                if (result == null)
                {
                    throw new UTFailBuildException("Unable to load the asset " + file, this);
                }
                return(result);
            });
        }


        var theBuildTarget = targetPlatform.EvaluateIn(context);

        if (pushDependencies.EvaluateIn(context))
        {
            UTAssetDependencyStack.Push();
        }

        try {
            UTFileUtils.EnsureParentFolderExists(theOutputFile);
            if (theBundleType == UTTypeOfBundle.StreamedScenes)
            {
                Debug.Log("Building streamed scenes asset bundle.");
                var result = BuildPipeline.BuildStreamedSceneAssetBundle(theFiles, theOutputFile, theBuildTarget);
                if (!string.IsNullOrEmpty(result))
                {
                    throw new UTFailBuildException("Building streamed scene asset bundle failed. " + result, this);
                }
            }
            else
            {
                Debug.Log("Building asset bundle.");
                var realCollectDependencies      = collectDependencies.EvaluateIn(context);
                var realCompleteAssets           = completeAssets.EvaluateIn(context);
                var realDisableWriteTypeTree     = disableWriteTypeTree.EvaluateIn(context);
                var realDeterministicAssetBundle = deterministicAssetBundle.EvaluateIn(context);


                var buildOpts = (BuildAssetBundleOptions)0;

                if (realCollectDependencies)
                {
                    buildOpts |= BuildAssetBundleOptions.CollectDependencies;
                }

                if (realCompleteAssets)
                {
                    buildOpts |= BuildAssetBundleOptions.CompleteAssets;
                }

                if (realDisableWriteTypeTree)
                {
                    buildOpts |= BuildAssetBundleOptions.DisableWriteTypeTree;
                }

                if (realDeterministicAssetBundle)
                {
                    buildOpts |= BuildAssetBundleOptions.DeterministicAssetBundle;
                }

                if (!BuildPipeline.BuildAssetBundle(realMainAsset, realAssets, theOutputFile, buildOpts, theBuildTarget))
                {
                    throw new UTFailBuildException("Building asset bundle failed.", this);
                }
            }
            Debug.Log("Built asset bundle at " + theOutputFile);
        } finally {
            if (popAllDependencies.EvaluateIn(context))
            {
                UTAssetDependencyStack.PopAll();
            }
            else if (popDependencies.EvaluateIn(context))
            {
                UTAssetDependencyStack.Pop();
            }
        }
        yield return("");
    }
Exemplo n.º 28
0
    public override IEnumerator Execute(UTContext context)
    {
        string theOutputProperty = outputProperty.EvaluateIn(context);

        if (string.IsNullOrEmpty(theOutputProperty))
        {
            throw new UTFailBuildException("output property is required.", this);
        }

        IEnumerable objects;
        string      theInputProperty = inputProperty.EvaluateIn(context);

        if (string.IsNullOrEmpty(theInputProperty))
        {
            objects = Resources.FindObjectsOfTypeAll(typeof(GameObject));
        }
        else
        {
            var inputList = context [theInputProperty];
            objects = inputList as IEnumerable;
            if (objects == null)
            {
                if (inputList == null)
                {
                    throw new UTFailBuildException("Property '" + theInputProperty + "' has a null value. Cannot use this as input.", this);
                }
                throw new UTFailBuildException("Property '" + theInputProperty + "' is of type '" + inputList.GetType() + "'. Cannot use this as input.", this);
            }
        }

        var filter = GetFilterForMode(context);

        var doFindNonMatching = findNonMatching.EvaluateIn(context);

        IList result   = new ArrayList();
        var   objCount = 0;

        foreach (UObject o in objects)
        {
            if (o.hideFlags == HideFlags.HideAndDontSave || o.hideFlags == HideFlags.DontSave)
            {
                // skip objects that wouldn't be persisted anyways..
                continue;
            }


            var prefabType = PrefabUtility.GetPrefabType(o);

            if (prefabType == PrefabType.ModelPrefab || prefabType == PrefabType.Prefab)
            {
                continue;                 // don't grab any assets.
            }

            objCount++;

            if (filter.Accept(o) != doFindNonMatching)
            {
                result.Add(o);
            }
        }

        if (UTPreferences.DebugMode)
        {
            Debug.Log("Filtered " + result.Count + " game objects from " + objCount + ".", this);
        }
        context [theOutputProperty] = result;
        yield return("");
    }
Exemplo n.º 29
0
    public override IEnumerator Execute(UTContext context)
    {
        DeletionType theDeletionType = deletionType.EvaluateIn(context);
        var          doDryRun        = dryRun.EvaluateIn(context);

        if (theDeletionType == DeletionType.SingleFileOrFolder)
        {
            var theSingleFileOrFolder = fileOrFolder.EvaluateIn(context);
            if (string.IsNullOrEmpty(theSingleFileOrFolder))
            {
                throw new UTFailBuildException("You need to specify the name of the file or folder to be deleted.", this);
            }
            if (doDryRun)
            {
                Debug.Log("[Dry Run] Would delete " + theSingleFileOrFolder);
            }
            else
            {
                FileAttributes attributes;
                try {
                    attributes = File.GetAttributes(theSingleFileOrFolder);
                }
                catch (DirectoryNotFoundException) {
                    if (UTPreferences.DebugMode)
                    {
                        Debug.Log("File " + theSingleFileOrFolder + " already deleted.");
                    }
                    yield break;
                }
                if ((attributes & FileAttributes.Directory) == FileAttributes.Directory)
                {
                    if (UTPreferences.DebugMode)
                    {
                        Debug.Log("Deleting directory " + theSingleFileOrFolder);
                    }
                    Directory.Delete(theSingleFileOrFolder, true);
                }
                else
                {
                    if (UTPreferences.DebugMode)
                    {
                        Debug.Log("Deleting file " + theSingleFileOrFolder);
                    }
                    File.Delete(theSingleFileOrFolder);
                }
            }
        }
        else
        {
            var theBaseDirectory = baseDirectory.EvaluateIn(context);
            if (string.IsNullOrEmpty(theBaseDirectory))
            {
                theBaseDirectory = UTFileUtils.ProjectRoot;
            }
            if (!Directory.Exists(theBaseDirectory))
            {
                Debug.Log("Base directory " + theBaseDirectory + " does not exist. Skipping delete action.");
            }
            else
            {
                theBaseDirectory = UTFileUtils.NormalizeSlashes(theBaseDirectory);

                var theIncludes = EvaluateAll(includes, context);
                var theExcludes = EvaluateAll(excludes, context);

                var theStuff = UTFileUtils.CalculateFileset(theBaseDirectory, theIncludes, theExcludes, UTFileUtils.FileSelectionMode.FilesAndFolders);


                Debug.Log("Deleting " + theStuff.Length + " files & directories.");

                for (int i = 0; i < theStuff.Length; i++)
                {
                    context.LocalProgress = ((float)i) / ((float)theStuff.Length);

                    var stuff  = theStuff [i];
                    var exists = File.Exists(stuff) || Directory.Exists(stuff);
                    if (!exists)
                    {
                        Debug.LogWarning(stuff + " does no longer exist. Check if your fileset can be simplified.");
                        // maybe was a subfolder of a directory that got deleted before.
                        continue;
                    }
                    var attributes = File.GetAttributes(stuff);
                    if ((attributes & FileAttributes.Directory) == FileAttributes.Directory)
                    {
                        if (doDryRun)
                        {
                            Debug.Log("[Dry Run] Would delete directory " + stuff);
                        }
                        else
                        {
                            if (UTPreferences.DebugMode)
                            {
                                Debug.Log("Deleting directory " + stuff);
                            }
                            Directory.Delete(stuff, true);
                        }
                    }
                    else
                    {
                        if (doDryRun)
                        {
                            Debug.Log("[Dry Run] Would delete file" + stuff);
                        }
                        else
                        {
                            if (UTPreferences.DebugMode)
                            {
                                Debug.Log("Deleting file " + stuff);
                            }
                            File.Delete(stuff);
                        }
                    }
                    yield return("");
                }
            }
        }
    }
Exemplo n.º 30
0
    public override IEnumerator Execute(UTContext context)
    {
        var theOutput = outputFileName.EvaluateIn(context);

        if (string.IsNullOrEmpty(theOutput))
        {
            throw new UTFailBuildException("You must specify an output file name.", this);
        }

        if (theOutput.StartsWith(Application.dataPath))
        {
            throw new UTFailBuildException("Building a player inside the assets folder will break the build. Please place it somewhere else.", this);
        }


        var theTarget = targetPlatform.EvaluateIn(context);

        if (addPlatformExtension.EvaluateIn(context))
        {
            theOutput += GetPlatformExtension(theTarget);
            UTFileUtils.EnsureParentFolderExists(theOutput);
        }

#if UNITY_4_1
        // workaround for UNITY_4_1 offering StandaloneOSXUniversal but not being able to build for it.
        if (theTarget == BuildTarget.StandaloneOSXUniversal)
        {
            theTarget = BuildTarget.StandaloneOSXIntel;
        }
#endif

        var useBuildSettings = useScenesFromBuildSettings.EvaluateIn(context);

        string[] scenes;
        if (!useBuildSettings)
        {
            // get them from includes/excludes
            var theIncludes = EvaluateAll(includes, context);
            var theExcludes = EvaluateAll(excludes, context);

            var fileSet = UTFileUtils.CalculateFileset(theIncludes, theExcludes);
            if (fileSet.Length == 0)
            {
                throw new UTFailBuildException("The file set yielded no scenes to include into the player.", this);
            }

            scenes = fileSet;
        }
        else
        {
            var scenesFromEditor = EditorBuildSettings.scenes;
            if (scenesFromEditor.Length == 0)
            {
                throw new UTFailBuildException("There are no scenes set up in the editor build settings.", this);
            }
            var active = Array.FindAll(scenesFromEditor, scene => scene.enabled);
            scenes = Array.ConvertAll(active, scene => scene.path);
        }

        if (UTPreferences.DebugMode)
        {
            foreach (var entry in scenes)
            {
                Debug.Log("Adding scene: " + entry, this);
            }
        }

        BuildOptions buildOptions = BuildOptions.None;
        if (developmentBuild.EvaluateIn(context))
        {
            buildOptions |= BuildOptions.Development;
        }

        if (runTheBuiltPlayer.EvaluateIn(context))
        {
            buildOptions |= BuildOptions.AutoRunPlayer;
        }

        if (showTheBuiltPlayer.EvaluateIn(context))
        {
            buildOptions |= BuildOptions.ShowBuiltPlayer;
        }

        if (buildStreamedScenes.EvaluateIn(context))
        {
            buildOptions |= BuildOptions.BuildAdditionalStreamedScenes;
        }

        if (acceptExternalModifications.EvaluateIn(context))
        {
            buildOptions |= BuildOptions.AcceptExternalModificationsToPlayer;
        }

        if (connectWithProfiler.EvaluateIn(context))
        {
            buildOptions |= BuildOptions.ConnectWithProfiler;
        }

        if (allowDebugging.EvaluateIn(context))
        {
            buildOptions |= BuildOptions.AllowDebugging;
        }

        if (uncompressedAssetBundle.EvaluateIn(context))
        {
            buildOptions |= BuildOptions.UncompressedAssetBundle;
        }

        if (theTarget == BuildTarget.WebPlayer || theTarget == BuildTarget.WebPlayerStreamed)
        {
            if (offlineDeployment.EvaluateIn(context))
            {
                buildOptions |= BuildOptions.WebPlayerOfflineDeployment;
            }
            if (deployOnline.EvaluateIn(context))
            {
                //buildOptions |= BuildOptions.DeployOnline;
            }
        }

        if (theTarget == BuildTarget.iOS)
        {
            if (symlinkLibraries.EvaluateIn(context))
            {
                buildOptions |= BuildOptions.SymlinkLibraries;
            }
        }


        Debug.Log("Building " + ObjectNames.NicifyVariableName(theTarget.ToString()) + " player including " + scenes.Length + " scenes to " + theOutput);
        yield return("");

        if (pushDependencies.EvaluateIn(context))
        {
            UTAssetDependencyStack.Push();
        }
        try {
            // build the player.
            var result = BuildPipeline.BuildPlayer(scenes, theOutput, theTarget, buildOptions);
            if (!string.IsNullOrEmpty(result))
            {
                throw new UTFailBuildException("Building the player failed. " + result, this);
            }
        }
        finally {
            if (popAllDependencies.EvaluateIn(context))
            {
                UTAssetDependencyStack.PopAll();
            }
            else if (popDependencies.EvaluateIn(context))
            {
                UTAssetDependencyStack.Pop();
            }
        }
    }