protected override void Build(BuildPlayersResult results) { // Check the group first string message; foreach (IChildBuildSetting setting in allSettings) { // Check if prebuild check failed if (setting.PreBuildCheck(out message) == false) { // Display a message DisplayPreBuildCheckFailed(message); // Stop building entirely return; } } // Indicate group build started using (new BuildPlayersResult.GroupBuildScope(results, this)) { // Build the list of settings BuildGroup(allSettings, results); } }
private static void UpdateResults(BuildPlayersResult results, bool isError) { // Grab the result's state RootBuildSetting.BuildProgression state = results.OnBuildCancelled; if (isError == true) { state = results.OnBuildFailed; } // Check if we need to display a dialog if (state == RootBuildSetting.BuildProgression.AskWhetherToContinue) { // Display the dialog, and update the build failed state state = results.DisplayBuildProgressionDialog(isError); // Update the result as well if (isError == true) { results.OnBuildFailed = state; } else { results.OnBuildCancelled = state; } } // Check if we need to halt building if (state == RootBuildSetting.BuildProgression.HaltImmediately) { // Halt immediately results.IsAllBuildsCancelled = true; } }
/// <summary> /// Recursively creates builds. /// </summary> /// <param name="results">List of statuses indicating the results</param> /// <returns></returns> public virtual BuildPlayersResult Build() { BuildPlayersResult results = SetupResults(); Build(results); return(results); }
/// <summary> /// Recursively creates builds. /// </summary> /// <param name="results">List of statuses indicating the results</param> /// <returns></returns> public override BuildPlayersResult Build() { // Setup variables BuildPlayersResult results = SetupResults(); Stack <GroupBuildSetting> embeddedSettings = new Stack <GroupBuildSetting>(); // Go through all the parents IChildBuildSetting checkParent = parentSetting as IChildBuildSetting; while (checkParent != null) { // Check if the parent is a group build setting if (checkParent is GroupBuildSetting) { embeddedSettings.Push((GroupBuildSetting)checkParent); } // Go to the parent of the current setting we're reviewing checkParent = checkParent.parentSetting as IChildBuildSetting; } // Go through the stack Stack <BuildPlayersResult.GroupBuildScope> embeddedScopes = new Stack <BuildPlayersResult.GroupBuildScope>(embeddedSettings.Count); while (embeddedSettings.Count > 0) { embeddedScopes.Push(new BuildPlayersResult.GroupBuildScope(results, embeddedSettings.Pop())); } Build(results); while (embeddedScopes.Count > 0) { embeddedScopes.Pop().Dispose(); } return(results); }
protected void DrawBuildButton(string buttonText = "Build") { if (GUI.Button(EditorGUILayout.GetControlRect(), buttonText) == true) { IBuildSetting setting = target as IBuildSetting; if (setting != null) { BuildPlayersResult results = setting.Build(); Debug.Log(results); } } }
/// <summary> /// Helper method to build a list of settings. /// </summary> /// <param name="settings">All the build settings to build from.</param> /// <param name="results">List of statuses indicating the results</param> /// <returns>True if the build was successful.</returns> protected static void BuildGroup(IEnumerable <IChildBuildSetting> settings, BuildPlayersResult results) { // Go through all settings foreach (IChildBuildSetting setting in settings) { // First, check if we didn't cancel the build if (results.IsAllBuildsCancelled == true) { return; } // Make a build setting.Build(results); if (results.LastReport.State == BuildPlayersResult.Status.Error) { UpdateResults(results, true); } else if (results.LastReport.State == BuildPlayersResult.Status.Cancelled) { UpdateResults(results, true); } } }
public GroupBuildScope(BuildPlayersResult result, IBuildSetting setting) { this.result = result; this.setting = setting; result.AddGroupReport(true, setting); }
/// <summary> /// Creates builds specific to this setting. /// </summary> /// <param name="results">List of statuses indicating the results</param> /// <returns>True if the build was successful.</returns> protected abstract void Build(BuildPlayersResult results);