private void AddGroupReport(bool isEntering, IBuildSetting source) { allReports.Add(new GroupReport(isEntering, source)); // Check if source is a Group if (source is GroupBuildSetting) { // Check whether to stack the group GroupBuildSetting groupSetting = (GroupBuildSetting)source; if (groupSetting.IsInEmbeddedFolder == true) { if (isEntering == false) { if (allEmbeddedGroups.Count > 0) { allEmbeddedGroups.RemoveAt(allEmbeddedGroups.Count - 1); } folderNameCache = null; } else { allEmbeddedGroups.Add(groupSetting); if (folderNameCache != null) { folderNameCache = ConcatenateFolders(folderNameCache, groupSetting.FolderName); } } } } }
public string ToString(IBuildSetting setting) { // Append all the text into one StringBuilder builder = new StringBuilder(); GetText method; foreach (Prefill name in names) { if (TextMapper.TryGetValue(name.Type, out method) == true) { builder.Append(method(name.Text, setting)); } } // Remove invalid characters string returnString = builder.ToString(); returnString = Helpers.RemoveDiacritics(returnString, builder); // Check if this needs to be a slug if (asSlug == true) { returnString = UrlHelpers.GenerateSlug(returnString); } return(returnString); }
protected override List <IBuildSetting> GetAllParentSettings(int initialCapacity) { List <IBuildSetting> parentSettings = new List <IBuildSetting>(initialCapacity); IBuildSetting parentSetting = parentProperty.objectReferenceValue as IBuildSetting; while (parentSetting != null) { // Add the setting into the list parentSettings.Add(parentSetting); // Check if this setting has a parent if (parentSetting is IChildBuildSetting) { // If so, grab it parentSetting = ((IChildBuildSetting)parentSetting).Parent; } else { // If not, terminate the loop break; } } return(parentSettings); }
public GroupReport(bool isEntering, IBuildSetting source) : base(source) { State = Status.ExitGroup; if (isEntering == true) { State = Status.EnterGroup; } }
public BuildPlayersResult(RootBuildSetting root, IBuildSetting info) { allReports = new List <IReport>(info.MaxNumberOfResults); allEmbeddedGroups = new List <GroupBuildSetting>(info.MaxNumberOfResults); //StringBuilder builder = new StringBuilder(); //CustomFileName.RemoveDiacritics(builder, PlayerSettings.productName); //AppName = builder.ToString(); Setup(root); }
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); } } }
public ChildReport(BuildReport report, IBuildSetting source) : base(source) { switch (report.summary.result) { case BuildResult.Succeeded: State = Status.Success; break; case BuildResult.Cancelled: State = Status.Cancelled; break; default: State = Status.Error; break; } // Set property Report = report; }
protected void DrawButtons(Rect rect, UnityEngine.Object serializedObject) { // Unindent bool originalEnabled = GUI.enabled; rect.x -= EditorHelpers.IndentSpace; rect.width += EditorHelpers.IndentSpace; // Update enabled stuff IBuildSetting setting = serializedObject as IBuildSetting; GUI.enabled = (setting != null); // Draw Edit Button rect.width -= (EditorHelpers.VerticalMargin * 2); rect.width /= 3f; if (GUI.Button(rect, "Edit") == true) { // Select object Selection.activeObject = serializedObject; } // Draw Duplicate Button rect.x += EditorHelpers.VerticalMargin; rect.x += rect.width; if (GUI.Button(rect, "Duplicate") == true) { // Duplicate object Duplicate(serializedObject.name + " (Clone)", serializedObject); } // Draw build button rect.x += EditorHelpers.VerticalMargin; rect.x += rect.width; if (GUI.Button(rect, "Build") == true) { // Make a build Debug.Log(setting.Build()); } GUI.enabled = originalEnabled; }
protected override void OnHeaderGUI() { // Setup the title header using (new EditorGUILayout.VerticalScope("In BigTitle")) { // Draw the name of this asset GUILayout.Label(target.name, EditorStyles.largeLabel); // Draw a quick label indicating the purpose of this slider view GUILayout.Label("Navigation:", EditorStyles.miniBoldLabel, GUILayout.ExpandWidth(false)); // Setup the scroll view using (EditorGUILayout.ScrollViewScope sScope = new EditorGUILayout.ScrollViewScope(scrollPos, true, false, GUI.skin.horizontalScrollbar, GUIStyle.none, GUIStyle.none, GUILayout.MinHeight(BackHeight))) using (EditorGUILayout.HorizontalScope hScope = new EditorGUILayout.HorizontalScope(GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true))) { // Starting with a list of size of 3 (latter number is arbitrary) List <IBuildSetting> parentSettings = GetAllParentSettings(3); if ((parentSettings != null) && (parentSettings.Count > 0)) { // Go through the parent settings in reverse order for (int index = (parentSettings.Count - 1); index >= 0; --index) { // Draw the button IBuildSetting parentSetting = parentSettings[index]; if (GUILayout.Button(parentSetting.name, EditorStyles.foldout, GUILayout.ExpandWidth(false)) == true) { Selection.activeObject = parentSetting; } } } // Draw a normal text GUILayout.Label(target.name, EditorStyles.foldout, GUILayout.ExpandWidth(false)); // Update scroll position scrollPos = sScope.scrollPosition; } } }
public IReport(IBuildSetting source) { Source = source; }
public void AddPostBuildReport(Status state, string message, IBuildSetting source) { allReports.Add(new PostBuildReport(state, message, source)); }
public void AddReport(BuildReport report, IBuildSetting source) { allReports.Add(new ChildReport(report, source)); }
public GroupBuildScope(BuildPlayersResult result, IBuildSetting setting) { this.result = result; this.setting = setting; result.AddGroupReport(true, setting); }
public PostBuildReport(Status state, string message, IBuildSetting source) : base(source) { State = state; Message = message; }
protected static void AddSetting(IBuildSetting parent, List <IChildBuildSetting> allSettings, IChildBuildSetting setting) { setting.Parent = parent; allSettings.Add(setting); }