/// <summary> /// Draws a list's line. /// </summary> /// <param name="list">Target list</param> /// <param name="index">Line index</param> /// <param name="readOnly">Should the line be editable? If FALSE it will draw a Label. If TRUE it will draw a TextField with - and + buttons</param> /// <param name="width">Width of the line</param> /// <returns></returns> string DrawListItem(List <string> list, int index, bool readOnly, float width, float height) { if (readOnly) { QUI.Label(list[index], Style.Text.Normal, width, height); } else { QUI.BeginHorizontal(width); { list[index] = EditorGUILayout.TextField(list[index], GUILayout.Width(width - 41), GUILayout.Height(height)); if (index == 0 && string.IsNullOrEmpty(list[index])) { } else { QUI.SetGUIBackgroundColor(QColors.RedLight.Color); if (QUI.ButtonMinus()) { list.Remove(list[index]); QUI.ResetColors(); return(""); } QUI.ResetColors(); QUI.Space(1); QUI.SetGUIBackgroundColor(QColors.GreenLight.Color); if (QUI.ButtonPlus()) { list.Insert(index, ""); } QUI.ResetColors(); } } QUI.EndHorizontal(); } return(list[index]); }
void DrawAbout() { QUI.DrawTexture(DUIResources.headerAbout.texture, 552, 64); float sectionWidth = PAGE_WIDTH - SIDE_BAR_SHADOW_WIDTH * 2; QUI.Space(SPACE_16); QUI.DrawTexture(DUIResources.pageAboutDoozyUIVersion.texture, 552, 256); QUI.Space(SPACE_16); DrawArticle("About DoozyUI", "DoozyUI is a complete UI management system for Unity. " + "It manipulates native Unity components and takes full advantage of their intended usage. " + "This assures maximum compatibility with uGUI, best performance and makes the entire system have a predictable behaviour. " + "Also, by working only with native components, the system will be compaible with any ohter asset that uses uGUI correctly. " + "\n\n" + "Easy to use and understand, given the user has some basic knowledge of how Unity's native UI solution (uGUI) works, DoozyUI has flexible components that can be configured in a lot of ways. " + "Functionality and design go hand in hand in order to offer a pleasant user experience (UX) while using the system." + "\n\n" + "Starting with version 2.8, DoozyUI is officialy VR READY, being capable of handling with ease multiple Canvases set to World Space render mode. " + "The system has been redesigned, from the core up, in order to accomodate a higher degree of flexibility that was needed in order for it to handle a lot of different use case scenarios." + "\n\n" + "The asset 'DoozyUI' has been released on the Unity Asset Store under the 'Doozy Entertainment' brand, owned by the Marlink Trading SRL company.", sectionWidth); }
bool CheckThatFolderExists(string relativePath) { if (!System.IO.Directory.Exists(relativePath)) { QUI.Space(SPACE_4); QLabel.text = "This folder does not exist. Click to create it."; QLabel.style = Style.Text.Help; QUI.BeginVertical(16, 16); { QUI.Space(2); QUI.DrawTexture(QResources.iconError.texture, 14, 14); } QUI.EndVertical(); QUI.Space(-SPACE_2); QUI.Label(QLabel); return(true); } return(false); }
void DrawSideBar() { QUI.BeginVertical(WindowSettings.SidebarCurrentWidth); { DrawSideBarLogo(); DrawSideBarExpandCollapseButton(); QUI.Space(WindowSettings.sidebarVerticalSpacing); DrawSideButton(Page.General, "General", DUIStyles.GetStyle(DUIStyles.SideButton.ControlPanel), DUIStyles.GetStyle(DUIStyles.SideButton.ControlPanelSelected)); QUI.Space(WindowSettings.sidebarVerticalSpacing); DrawSideButton(Page.UIElements, "UIElements", DUIStyles.GetStyle(DUIStyles.SideButton.UIElements), DUIStyles.GetStyle(DUIStyles.SideButton.UIElementsSelected)); DrawSideButton(Page.UIButtons, "UIButtons", DUIStyles.GetStyle(DUIStyles.SideButton.UIButtons), DUIStyles.GetStyle(DUIStyles.SideButton.UIButtonsSelected)); DrawSideButton(Page.UISounds, "UISounds", DUIStyles.GetStyle(DUIStyles.SideButton.UISounds), DUIStyles.GetStyle(DUIStyles.SideButton.UISoundsSelected)); DrawSideButton(Page.UICanvases, "UICanvases", DUIStyles.GetStyle(DUIStyles.SideButton.UICanvases), DUIStyles.GetStyle(DUIStyles.SideButton.UICanvasesSelected)); DrawSideButton(Page.AnimatorPresets, "Animator Presets", DUIStyles.GetStyle(DUIStyles.SideButton.AnimatorPresets), DUIStyles.GetStyle(DUIStyles.SideButton.AnimatorPresetsSelected)); QUI.Space(WindowSettings.sidebarVerticalSpacing); DrawSideButton(Page.EditorSettings, "Editor Settings", DUIStyles.GetStyle(DUIStyles.SideButton.EditorSettings), DUIStyles.GetStyle(DUIStyles.SideButton.EditorSettingsSelected)); QUI.Space(WindowSettings.sidebarVerticalSpacing); DrawSideButton(Page.Help, "Help", DUIStyles.GetStyle(DUIStyles.SideButton.Help), DUIStyles.GetStyle(DUIStyles.SideButton.HelpSelected)); DrawSideButton(Page.About, "About", DUIStyles.GetStyle(DUIStyles.SideButton.About), DUIStyles.GetStyle(DUIStyles.SideButton.AboutSelected)); QUI.FlexibleSpace(); DrawSideBarSocial(); } QUI.EndVertical(); }
public override void OnInspectorGUI() { DrawHeader(DUIResources.headerUIEffect.texture, WIDTH_420, HEIGHT_42); serializedObject.Update(); if (!EditorSettings.UIEffect_Inspector_ShowButtonRenameGameObject || (uiEffect.targetUIElement != null && uiEffect.targetUIElement.linkedToNotification)) { } else { DrawRenameGameObjectButton(GlobalWidth); QUI.Space(SPACE_4); } DrawAddParticleSystemButton(GlobalWidth); QUI.Space(SPACE_4); DrawTargetParticleSystem(GlobalWidth); QUI.Space(SPACE_4); DrawTargetUIElement(GlobalWidth); QUI.Space(SPACE_2); if (uiEffect.targetParticleSystem != null && uiEffect.targetUIElement != null) { DrawSortingLayerName(GlobalWidth); DrawSortingOrder(GlobalWidth); QUI.Space(SPACE_4); DrawSettings(GlobalWidth); } serializedObject.ApplyModifiedProperties(); QUI.Space(SPACE_4); }
void DrawControlPanelGeneralSupportedAssets(float width) { QUI.BeginVertical(width); { QLabel.text = "3rd Party Assets Integration"; QLabel.style = Style.Text.Tiny; QUI.BeginHorizontal(width); { QUI.FlexibleSpace(); QUI.Label(QLabel); QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.Space(SPACE_2); DrawControlPanelGeneralButton("PlayMaker", buttonStylePlayMaker, DUI.PlayMakerEnabled, DUI.SYMBOL_PLAYMAKER, width, false, true); QUI.Space(SPACE_8); DrawControlPanelGeneralButton("MasterAudio", buttonStyleMasterAudio, DUI.MasterAudioEnabled, DUI.SYMBOL_MASTER_AUDIO, width, false, true); QUI.Space(SPACE_8); DrawControlPanelGeneralButton("EnergyBarToolkit", buttonStyleEnergyBarToolkit, DUI.EnergyBarToolkitEnabled, DUI.SYMBOL_ENERGY_BAR_TOOLKIT, width, false, true); QUI.Space(SPACE_8); DrawControlPanelGeneralButton("TextMeshPro", buttonStyleTextMeshPro, DUI.TextMeshProEnabled, DUI.SYMBOL_TEXT_MESH_PRO, width, false, true); } QUI.EndVertical(); }
/// <summary> /// Imports a new AES key/iv list from the selected CSV file. Validates the import and returns true if successful, false otherwise. /// </summary> /// <param name="ezEncryptionKeys">Reference to the EzEncryptionKeys ScriptableObject</param> /// <returns>Returns true if successful, false otherwise.</returns> public static bool RestoreEncryptionKeysFromCSV(EzEncryptionKeys ezEncryptionKeys) { try { string path = EditorUtility.OpenFilePanel("Restore from CSV", EZT.PATH + "/DataManager/Editor/KeysBackup/", "csv"); string[] tempStringArray = File.ReadAllLines(path, Encoding.UTF8); string[] tempStrSplit; if (tempStringArray.Length == 0) { return(false); } // Parse the import data once to validate it for (int i = 0; i < tempStringArray.Length; i++) { tempStrSplit = ASCIIEncoding.UTF8.GetString(Convert.FromBase64String(tempStringArray[i])).Split(','); if (!ezEncryptionKeys.ValidateKeyAndIV(Convert.FromBase64String(tempStrSplit[0]), Convert.FromBase64String(tempStrSplit[1]))) { return(false); } } // Import validated, overwrite existing keys ezEncryptionKeys.ClearEncryptionKeysAndIVs(); for (int i = 0; i < tempStringArray.Length; i++) { tempStrSplit = ASCIIEncoding.UTF8.GetString(Convert.FromBase64String(tempStringArray[i])).Split(','); ezEncryptionKeys.AddNewKeyAndIV(Convert.FromBase64String(tempStrSplit[0]), Convert.FromBase64String(tempStrSplit[1])); } QUI.SetDirty(ezEncryptionKeys); AssetDatabase.SaveAssets(); } catch (Exception) { return(false); } return(true); }
void DrawArrowHolder(string direction, SerializedProperty holder, SerializedProperty closed, SerializedProperty opened, float width) { QUI.BeginHorizontal(width - SPACE_8); { QUI.Space(SPACE_8 * showArrowReferences.faded); QUI.QObjectPropertyField(direction + " Drawer Arrow Holder", holder, width - 16, 20, true); QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.BeginHorizontal(width - SPACE_8); { QUI.Space(SPACE_16 * showArrowReferences.faded); QUI.QObjectPropertyField("Closed Position", closed, width - 24, 20, true); QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.BeginHorizontal(width - SPACE_8); { QUI.Space(SPACE_16 * showArrowReferences.faded); QUI.QObjectPropertyField("Opened Position", opened, width - 24, 20, true); QUI.FlexibleSpace(); } QUI.EndHorizontal(); }
void DrawRenameGameObjectButton(float width) { QUI.BeginHorizontal(width); { if (QUI.GhostButton("Rename GameObject to Drawer Name", QColors.Color.Gray, width, 18)) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Renamed Multiple Objects"); for (int i = 0; i < targets.Length; i++) { UIDrawer uid = (UIDrawer)targets[i]; uid.gameObject.name = "UID - " + uid.GetDrawerName(); } } else { Undo.RecordObject(Drawer.gameObject, "Renamed GameObject"); Drawer.gameObject.name = "UID - " + Drawer.GetDrawerName(); } } } QUI.EndHorizontal(); }
void DrawTargetFSM() { QUI.BeginHorizontal(WIDTH_420); { GUI.enabled = overrideTargetFSM.boolValue; QUI.QObjectPropertyField("Target FSM", targetFSM, WIDTH_420 - 78); GUI.enabled = true; if (targetFSM == null) { overrideTargetFSM.boolValue = true; } QUI.QToggle("override", overrideTargetFSM); } QUI.EndHorizontal(); QUI.Space(-SPACE_2); QUI.BeginHorizontal(WIDTH_420); { QUI.Space(78); QLabel.text = "FSM Name: " + (playmakerEventDispatcher.targetFSM == null ? "---" : playmakerEventDispatcher.targetFSM.FsmName); QLabel.style = Style.Text.Help; QUI.Label(QLabel); } QUI.EndHorizontal(); }
void OnGUI() { UpdateWindowSize(); DrawBackground(); QUI.BeginHorizontal(position.width); { DrawSideBar(); QUI.Space(mWindowSettings.pageShadowWidth); DrawPages(); } QUI.EndHorizontal(); if (Event.current.type != EventType.Layout) { if (PageScrollPosition != PageLastScrollPosition) //if the user has scrolled, deselect - this is because control IDs within carousel will change when scrolled so we'd end up with the wrong box selected. { GUI.FocusControl(""); //deselect PageLastScrollPosition = PageScrollPosition; } } Repaint(); }
void DrawTargetFSM() { QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Target FSM", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 68); GUI.enabled = overrideTargetFSM.boolValue; QUI.PropertyField(targetFSM, 276); GUI.enabled = true; if (targetFSM == null) { overrideTargetFSM.boolValue = true; } QUI.Toggle(overrideTargetFSM); QUI.Label("override", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), 54); } QUI.EndHorizontal(); QUI.BeginHorizontal(WIDTH_420); { QUI.Space(68); QUI.Label("FSM Name:", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 60); QUI.Label(playmakerEventDispatcher.targetFSM == null ? "---" : playmakerEventDispatcher.targetFSM.FsmName, DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmallItalic)); } QUI.EndHorizontal(); }
void DrawButtonName(float width) { QUI.BeginHorizontal(width); { if (EditorApplication.isPlayingOrWillChangePlaymode) { QLabel.text = buttonName.stringValue; QLabel.style = Style.Text.Help; QUI.Label(QLabel); } else { if (buttonCategory.stringValue.Equals(DUI.CUSTOM_NAME)) { QUI.PropertyField(buttonName, width - 5); } else { if (!DatabaseUIButtons.ContainsCategoryName(buttonCategory.stringValue)) //the category does not exist -> reset category and name { QUI.DisplayDialog("Info", "Button category has been reset to the default '" + DUI.UNCATEGORIZED_CATEGORY_NAME + "' value." + "\n\n" + "Button name has been reset to the default '" + DUI.DEFAULT_BUTTON_NAME + "' value.", "Ok"); //inform the dev that becuase he did not add the name to the database, it has been reset to its default value buttonCategory.stringValue = DUI.UNCATEGORIZED_CATEGORY_NAME; //reset the category buttonCategoryIndex = DatabaseUIButtons.CategoryNameIndex(buttonCategory.stringValue); //set the index buttonName.stringValue = DUI.DEFAULT_BUTTON_NAME; //reset the name buttonNameIndex = DatabaseUIButtons.ItemNameIndex(buttonCategory.stringValue, buttonName.stringValue); //set the index } else if (!DatabaseUIButtons.Contains(buttonCategory.stringValue, buttonName.stringValue)) //category does not contain the set name -> ask de dev is it should be added { if (QUI.DisplayDialog("Action Required", "The name '" + buttonName.stringValue + "' was not found in the '" + buttonCategory.stringValue + "' category." + "\n\n" + "Do you want to add it to the database?", "Yes", "No")) //ask the dev if he wants to add this name to the database { DatabaseUIButtons.GetCategory(buttonCategory.stringValue).AddItemName(buttonName.stringValue, true); //add the item name to the database and save buttonNameIndex = DatabaseUIButtons.ItemNameIndex(buttonCategory.stringValue, buttonName.stringValue); //set the index } else if (!DatabaseUIButtons.GetCategory(buttonCategory.stringValue).IsEmpty()) //select the first item in the category because it's not empty { buttonNameIndex = 0; //set the index buttonName.stringValue = DatabaseUIButtons.GetCategory(buttonCategory.stringValue).itemNames[buttonNameIndex]; //get the name } else //reset category and name { QUI.DisplayDialog("Info", "Button category has been reset to the default '" + DUI.UNCATEGORIZED_CATEGORY_NAME + "' value." + "\n\n" + "Button name has been reset to the default '" + DUI.DEFAULT_BUTTON_NAME + "' value.", "Ok"); //inform the dev that becuase he did not add the name to the database, it has been reset to its default value buttonCategory.stringValue = DUI.UNCATEGORIZED_CATEGORY_NAME; //reset the category buttonCategoryIndex = DatabaseUIButtons.CategoryNameIndex(buttonCategory.stringValue); //set the index buttonName.stringValue = DUI.DEFAULT_BUTTON_NAME; //reset the name buttonNameIndex = DatabaseUIButtons.ItemNameIndex(buttonCategory.stringValue, buttonName.stringValue); //set the index } } else //category contains the set name -> get its index { buttonNameIndex = DatabaseUIButtons.ItemNameIndex(buttonCategory.stringValue, buttonName.stringValue); //set the index } QUI.BeginChangeCheck(); buttonNameIndex = EditorGUILayout.Popup(buttonNameIndex, DatabaseUIButtons.GetCategory(buttonCategory.stringValue).itemNames.ToArray(), GUILayout.Width(width - 5)); if (QUI.EndChangeCheck()) { buttonName.stringValue = DatabaseUIButtons.GetCategory(buttonCategory.stringValue).itemNames[buttonNameIndex]; } } } QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.Space(SPACE_4); }
void DrawGameEventOptions(float width) { if (!triggerOnGameEvent.boolValue) { return; } buttonCategory.stringValue = DUI.UNCATEGORIZED_CATEGORY_NAME; buttonName.stringValue = DUI.DEFAULT_BUTTON_NAME; QUI.BeginHorizontal(width); { if (dispatchAll.boolValue) //if dispatchAll is enabled -> set game event to empty and disable the field { gameEvent.stringValue = string.Empty; //set game event as an empty string GUI.enabled = false; //disable gui } QLabel.text = "Game Event"; QLabel.style = Style.Text.Normal; QUI.BeginVertical(QLabel.x, QUI.SingleLineHeight); { QUI.Label(QLabel); QUI.Space(SPACE_2); } QUI.EndVertical(); tempFloat = QLabel.x; //save label width QLabel.text = "dispatch all"; //create and calculate a new label QLabel.style = Style.Text.Normal; tempFloat += QLabel.x; //add the second label width tempFloat += 12; //add the size of a toggle tempFloat += 8; //add space (4 to left and 4 to right) tempFloat += 24; QUI.SetNextControlName("gameEvent"); EditorGUILayout.DelayedTextField(gameEvent, GUIContent.none, GUILayout.Width(width - tempFloat)); GUI.enabled = true; //enable gui in case it was disabled by dispatch all QUI.BeginChangeCheck(); QUI.QToggle("dispatch all", dispatchAll); if (QUI.EndChangeCheck()) { if (triggerOnGameEvent.boolValue) { gameEvent.stringValue = dispatchAll.boolValue ? DUI.DISPATCH_ALL : string.Empty; if (!dispatchAll.boolValue) { QUI.FocusTextInControl("gameEvent"); } } else if (triggerOnButtonClick.boolValue || triggerOnButtonDoubleClick.boolValue || triggerOnButtonLongClick.boolValue) { buttonName.stringValue = dispatchAll.boolValue ? DUI.DISPATCH_ALL : DUI.DEFAULT_BUTTON_NAME; if (dispatchAll.boolValue) { buttonCategory.stringValue = DUI.UNCATEGORIZED_CATEGORY_NAME; } else { buttonCategory.stringValue = DUI.UNCATEGORIZED_CATEGORY_NAME; buttonName.stringValue = DUI.DEFAULT_BUTTON_NAME; ValidateButtonCategoryAndButtonName(); } } } QUI.FlexibleSpace(); } QUI.EndHorizontal(); infoMessage["SetGameEvent"].show.target = triggerOnGameEvent.boolValue && string.IsNullOrEmpty(gameEvent.stringValue) && !dispatchAll.boolValue; DrawInfoMessage("SetGameEvent", GlobalWidth); infoMessage["DispatchAllGameEvents"].show.target = dispatchAll.boolValue; DrawInfoMessage("DispatchAllGameEvents", width); }
void ValidateButtonCategoryAndButtonName() { if (dispatchAll.boolValue) { buttonCategory.stringValue = DUI.UNCATEGORIZED_CATEGORY_NAME; buttonName.stringValue = DUI.DISPATCH_ALL; return; } //CHECK FOR CUSTOM NAME if (uiTrigger.buttonCategory.Equals(DUI.CUSTOM_NAME)) //category is set to CUSTOM NAME -> get the index for the category name and set the name index to -1 { buttonCategoryIndex = DatabaseUIButtons.CategoryNameIndex(DUI.CUSTOM_NAME); //set the index buttonNameIndex = -1; //set the index return; //stop here as there is a CUSTOM NAME set } //SANITY CHECK FOR EMPTY CATEGORY NAME if (uiTrigger.buttonCategory.IsNullOrEmpty()) //category name is empty (sanity check) -> reset both category and name { uiTrigger.buttonCategory = DUI.UNCATEGORIZED_CATEGORY_NAME; //reset the value buttonCategoryIndex = DatabaseUIButtons.CategoryNameIndex(uiTrigger.buttonCategory); //set the index uiTrigger.buttonName = DUI.DEFAULT_BUTTON_NAME; //reset the value buttonNameIndex = DatabaseUIButtons.ItemNameIndex(uiTrigger.buttonCategory, uiTrigger.buttonName); //set the index return; } //CHECK THAT CATEGORY EXISTS IN THE DATABASE if (!DatabaseUIButtons.ContainsCategoryName(uiTrigger.buttonCategory)) //the set category does not exist in the database { if (QUI.DisplayDialog("Action Required", "The category '" + uiTrigger.buttonCategory + "' was not found in the database." + "\n\n" + "Do you want to add it to the database?", "Yes", "No")) //ask the dev if he wants to add this category to the database { DatabaseUIButtons.AddCategory(uiTrigger.buttonCategory, true); //add the category to the database and save buttonCategoryIndex = DatabaseUIButtons.CategoryNameIndex(uiTrigger.buttonCategory); //set the index } else { QUI.DisplayDialog("Info", "Button category has been reset to the default '" + DUI.UNCATEGORIZED_CATEGORY_NAME + "' value.", "Ok"); //inform the dev that becuase he did not add the category to the database, it has been reset to its default value uiTrigger.buttonCategory = DUI.UNCATEGORIZED_CATEGORY_NAME; //reset the value buttonCategoryIndex = DatabaseUIButtons.CategoryNameIndex(uiTrigger.buttonCategory); //set the index } } //CHECK THAT THE NAME EXISTS IN THE CATEGORY if (!DatabaseUIButtons.Contains(uiTrigger.buttonCategory, uiTrigger.buttonName)) //the set element name does not exist under the set category { if (QUI.DisplayDialog("Action Required", "The name '" + uiTrigger.buttonName + "' was not found in the '" + uiTrigger.buttonCategory + "' category." + "\n\n" + "Do you want to add it to the database?", "Yes", "No")) //ask the dev if he wants to add this name to the database { DatabaseUIButtons.GetCategory(uiTrigger.buttonCategory).AddItemName(uiTrigger.buttonName, true); //add the item name to the database and save buttonNameIndex = DatabaseUIButtons.ItemNameIndex(uiTrigger.buttonCategory, uiTrigger.buttonName); //set the index } else { QUI.DisplayDialog("Info", "Button name has been reset to the default '" + DUI.DEFAULT_BUTTON_NAME + "' value.", "Ok"); //inform the dev that becuase he did not add the name to the database, it has been reset to its default value uiTrigger.buttonName = DUI.DEFAULT_BUTTON_NAME; //reset the value buttonNameIndex = DatabaseUIButtons.ItemNameIndex(uiTrigger.buttonCategory, uiTrigger.buttonName); //set the index } } else { buttonCategoryIndex = DatabaseUIButtons.CategoryNameIndex(uiTrigger.buttonCategory); buttonNameIndex = DatabaseUIButtons.ItemNameIndex(uiTrigger.buttonCategory, uiTrigger.buttonName); } }
void DrawTrigger2D() { QUI.SetGUIBackgroundColor(accentColorPurple); QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Despawn After", Style.Text.Normal, 86); QUI.BeginChangeCheck(); QUI.PropertyField(despawnAfter, 100); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.despawnAfter = (PoolyDespawner.DespawnAfter)despawnAfter.enumValueIndex; } } } QUI.FlexibleSpace(); if (!orDespawnAfterTime.boolValue) { QUI.BeginChangeCheck(); QUI.Toggle(orDespawnAfterTime); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.orDespawnAfterTime = orDespawnAfterTime.boolValue; } } } QUI.Label("Or Despawn After Time", Style.Text.Normal, 126); } else { QUI.BeginChangeCheck(); QUI.Toggle(orDespawnAfterTime); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.orDespawnAfterTime = orDespawnAfterTime.boolValue; } } } QUI.Label("Or Despawn After", Style.Text.Normal, 106); QUI.BeginChangeCheck(); QUI.PropertyField(duration, 40); if (duration.floatValue <= 0) { duration.floatValue = 0; } if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.duration = duration.floatValue; } } } QUI.Label("seconds", Style.Text.Normal, 50); } } QUI.EndHorizontal(); QUI.ResetColors(); infoMessage["duration.floatValue"].show.target = duration.floatValue <= 0 && orDespawnAfterTime.boolValue; DrawInfoMessage("duration.floatValue", WIDTH_420); QUI.SetGUIBackgroundColor(accentColorPurple); QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Despawn OnTrigger2D", Style.Text.Normal, 130); QUI.Space(SPACE_8); QUI.BeginChangeCheck(); QUI.Toggle(despawnOnTriggerEnter2D); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.despawnOnTriggerEnter2D = despawnOnTriggerEnter2D.boolValue; } } } QUI.Label("Enter2D", Style.Text.Normal, 50); QUI.Space(SPACE_8); QUI.BeginChangeCheck(); QUI.Toggle(despawnOnTriggerStay2D); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.despawnOnTriggerStay2D = despawnOnTriggerStay2D.boolValue; } } } QUI.Label("Stay2D", Style.Text.Normal, 42); QUI.Space(SPACE_8); QUI.BeginChangeCheck(); QUI.Toggle(despawnOnTriggerExit2D); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.despawnOnTriggerExit2D = despawnOnTriggerExit2D.boolValue; } } } QUI.Label("Exit2D", Style.Text.Normal, 40); QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.Space(SPACE_4); QUI.BeginHorizontal(WIDTH_420); { QUI.PropertyField(onlyWithTag, 12); QUI.Label("Trigger Only By Tag", Style.Text.Normal, 114); QUI.BeginChangeCheck(); targetTag.stringValue = EditorGUILayout.TagField(targetTag.stringValue); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.targetTag = targetTag.stringValue; } } } QUI.Space(SPACE_4); } QUI.EndHorizontal(); QUI.ResetColors(); }
void DrawEffect() { QUI.SetGUIBackgroundColor(accentColorPurple); QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Despawn After", Style.Text.Normal, 86); QUI.BeginChangeCheck(); QUI.PropertyField(despawnAfter, 100); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.despawnAfter = (PoolyDespawner.DespawnAfter)despawnAfter.enumValueIndex; } } } QUI.FlexibleSpace(); QUI.BeginChangeCheck(); QUI.Toggle(playOnSpawn); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.playOnSpawn = playOnSpawn.boolValue; } } } QUI.Label("Play On Spawn", Style.Text.Normal, 84); } QUI.EndHorizontal(); if (poolyDespawner.pSystem == null) { QUI.Label("ParticleSystem: Not Found", Style.Text.Normal, WIDTH_420); infoMessage["poolyDespawner.pSystem"].show.target = true; } else { QUI.Label("ParticleSystem: " + poolyDespawner.pSystem.gameObject.name, Style.Text.Normal, WIDTH_420); QUI.BeginHorizontal(WIDTH_420); { QUI.BeginChangeCheck(); QUI.PropertyField(useParticleSystemDuration, 12); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.useParticleSystemDuration = useParticleSystemDuration.boolValue; } } } QUI.Label("Duration: " + poolyDespawner.pSystem.main.duration + " seconds", Style.Text.Normal, WIDTH_420 - 12); } QUI.EndHorizontal(); QUI.BeginHorizontal(WIDTH_420); { QUI.BeginChangeCheck(); QUI.PropertyField(useParticleSystemStartDelay, 12); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.useParticleSystemStartDelay = useParticleSystemStartDelay.boolValue; } } } QUI.Label("Start Delay: " + poolyDespawner.pSystem.main.startDelay.constant + " seconds", Style.Text.Normal, WIDTH_420); } QUI.EndHorizontal(); QUI.BeginHorizontal(WIDTH_420); { QUI.BeginChangeCheck(); QUI.PropertyField(useParticleSystemStartLifetime, 12); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.useParticleSystemStartLifetime = useParticleSystemStartLifetime.boolValue; } } } QUI.Label("Start Lifetime: " + poolyDespawner.pSystem.main.startLifetime.constant + " seconds", Style.Text.Normal, WIDTH_420); } QUI.EndHorizontal(); QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Extra Time", Style.Text.Normal, 65); QUI.BeginChangeCheck(); QUI.PropertyField(extraTime, 40); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.extraTime = extraTime.floatValue; } } } QUI.Label("seconds", Style.Text.Normal, 50); } QUI.EndHorizontal(); QUI.Space(SPACE_2); QUI.Button(QStyles.GetBackgroundStyle(Style.BackgroundType.Low, QColors.Color.Purple), WIDTH_420, 20); QUI.Space(-20); QUI.BeginHorizontal(WIDTH_420); { QUI.Space(2); QUI.Label("Total Duration until despawn: " + poolyDespawner.pSystemTotalDuration + " seconds", Style.Text.Normal, WIDTH_420); } QUI.EndHorizontal(); infoMessage["poolyDespawner.pSystem"].show.target = false; } QUI.ResetColors(); DrawInfoMessage("poolyDespawner.pSystem", WIDTH_420); }
void DrawSound() { QUI.SetGUIBackgroundColor(accentColorPurple); QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Despawn After", Style.Text.Normal, 86); QUI.BeginChangeCheck(); QUI.PropertyField(despawnAfter, 100); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.despawnAfter = (PoolyDespawner.DespawnAfter)despawnAfter.enumValueIndex; } } } QUI.FlexibleSpace(); QUI.BeginChangeCheck(); QUI.Toggle(playOnSpawn); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.playOnSpawn = playOnSpawn.boolValue; } } } QUI.Label("Play On Spawn", Style.Text.Normal, 84); } QUI.EndHorizontal(); if (poolyDespawner.aSource == null) { QUI.Label("AudioSource: Not Found", Style.Text.Normal, WIDTH_420); infoMessage["poolyDespawner.aSource"].show.target = true; infoMessage["poolyDespawner.aSource.clip"].show.target = false; } else if (poolyDespawner.aSource.clip == null) { QUI.Label("AudioSource: " + poolyDespawner.aSource.gameObject.name, Style.Text.Normal, WIDTH_420); QUI.Label("AudioClip: Not Found", Style.Text.Normal, WIDTH_420); infoMessage["poolyDespawner.aSource"].show.target = false; infoMessage["poolyDespawner.aSource.clip"].show.target = true; } else { QUI.Label("AudioSource: " + poolyDespawner.aSource.gameObject.name, Style.Text.Normal, WIDTH_420); QUI.Label("AudioClip: " + poolyDespawner.aSource.clip.name, Style.Text.Normal, WIDTH_420); QUI.Label("Duration: " + poolyDespawner.aSource.clip.length + " seconds", Style.Text.Normal, WIDTH_420); infoMessage["poolyDespawner.aSource"].show.target = false; infoMessage["poolyDespawner.aSource.clip"].show.target = false; } QUI.ResetColors(); DrawInfoMessage("poolyDespawner.aSource", WIDTH_420); DrawInfoMessage("poolyDespawner.aSource.clip", WIDTH_420); }
void DrawCloseButton(float width) { QUI.QObjectPropertyField("Close Button", closeButton, width); }
void DrawListenForBackButton(float width) { QUI.QToggle("Listen for the 'Back' button (close when pressing 'Back' or ESC)", listenForBackButton); }
void DrawArticle(string title, string text, float width) { QUI.Label(title, NewsTitleStyle, width); QUI.Space(-4); QUI.Label(text, NewsTextStyle, width); }
void DrawControlPanelDoozyModules(float width) { QUI.DrawTexture(DUIResources.pageControlPanelSeparatorDoozyModules.texture, 242, 16); QUI.Space(2); #region Orientation Manager if (EditorApplication.isCompiling) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorIsCompiling.texture, 242, 40); } else if (EditorApplication.isPlayingOrWillChangePlaymode) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorInPlayMode.texture, 242, 40); } else { QUI.BeginHorizontal(width); { #if dUI_UseOrientationManager if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonOrientationManagerEnabled), 242, 40)) { NotificationWindow.YesNo("Disable the Orientation Manager?", "This will remove '" + DUI.SYMBOL_ORIENTATION_MANAGER + "' from Scripting Define Symbols in Player Settings.", () => { QUtils.RemoveScriptingDefineSymbol(DUI.SYMBOL_ORIENTATION_MANAGER); }, null); } #else if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonOrientationManagerDisabled), 242, 40)) { NotificationWindow.YesNo("Enable the Orientation Manager?", "Enable this only if you want to create different UI's for each orientation." + "\n\n" + "This will add '" + DUI.SYMBOL_ORIENTATION_MANAGER + "' to Scripting Define Symbols in Player Settings.", () => { QUtils.AddScriptingDefineSymbol(DUI.SYMBOL_ORIENTATION_MANAGER); }, null); } #endif } QUI.EndHorizontal(); } #endregion QUI.Space(2); #region Navigation System if (EditorApplication.isCompiling) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorIsCompiling.texture, 242, 40); } else if (EditorApplication.isPlayingOrWillChangePlaymode) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorInPlayMode.texture, 242, 40); } else { QUI.BeginHorizontal(width); { #if dUI_NavigationDisabled if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonNavigationSystemDisabled), 242, 40)) { NotificationWindow.YesNo("Enable the Navigation Manager?", "This will remove '" + DUI.SYMBOL_NAVIGATION_SYSTEM + "' from Scripting Define Symbols in Player Settings.", () => { QUtils.RemoveScriptingDefineSymbol(DUI.SYMBOL_NAVIGATION_SYSTEM); }, null); } #else if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonNavigationSystemEnabled), 242, 40)) { NotificationWindow.YesNo("Disable the Navigation Manager?", "Do this if you intend to handle the navigation yourself (maybe by using Playmaker?)." + "\n\n" + "This will add '" + DUI.SYMBOL_NAVIGATION_SYSTEM + "' to Scripting Define Symbols in Player Settings.", () => { QUtils.AddScriptingDefineSymbol(DUI.SYMBOL_NAVIGATION_SYSTEM); }, null); } #endif } QUI.EndHorizontal(); } #endregion }
void DrawControlPanelNews(float width) { QUI.DrawTexture(DUIResources.pageControlPanelSeparatorNews.texture, 294, 16); DrawArticle("Hey lovely DoozyUI Users!", "We want to update you on a few things.", width - 16); QUI.Space(3); DrawArticle("Apologies", "First up, we’d like to apologize. " + "We’re a small team, and we’ve been trying to find the right balance between interacting with the community and getting work done. " + "If we spend too much time talking to folks, we don’t get as much done, and vice versa." + "\n\n" + "We fear we haven’t communicated enough, so we’ll be spending more time keeping you all informed and getting your thoughts. " + "Stay tuned.", width - 16); QUI.Space(3); DrawArticle("About DoozyUI", "We’ve been hard at work on this completely rewritten core for DoozyUI. " + "This means we should be able to crank out future releases much faster and with much less effort. " + "And the new code base is the best we’ve ever made — truly better design, better consistency, and better performance. " + "And honestly, DoozyUI is turning out better than we’d ever imagined." + "\n\n" + "The all-new features are crazy simple to use and they just work. " + "You get all the power of a complex UI management system with none of the hassle." + "\n\n" + "But we know it’s not perfect yet, and we’d love your feedback.", width - 16); QUI.Space(3); DrawArticle("The 2.8 Release", "This release is a huge milestone for us as it is the first big step towards the next major version." + "\n\n" + "The new custom editors were created with purpose in mind. " + "To this end, all the components went through several design iterations until we found a balance between functionality and ease of use." + "\n\n" + "New animation presets (over 400) were created for you so that you have a lot of 'out of the box' options." + "\n" + "All the components have new options and, for you coders out there, you will notice that new methods are available and that we added summaries to everything.", width - 16); QUI.Space(3); DrawArticle("Next Up", "We will be releasing minor versions 2.8.1, 2.8.2 and so on, where we will add some new options and components for the system. " + "Between them we will release quick patches for any issues that may arrise (so please tell us if you find any bugs)." + "\n\n" + "The next component will be the UIToggle. " + "Also, as soon as Font Awesome 5 is released to the general public, we'll add it as well (right now the alpha version looks incredible).", width - 16); QUI.Space(3); DrawArticle("The Future", "What we envision is installing DoozyUI, getting an UI pack (made for DoozyUI) from the Unity Asset Store and having a premade functional UI ready to go in your project in less than 5 minutes." + "\n\n" + "That is why we plan on giving you, all the UI designers out there, the option of creating premade UIs. " + "Right now we see a lot of UI graphic packs on the Unity Asset Store and we would love seeing those packs turned into 'out of the box' working UIs (not just static graphics). " + "This is one of the big features that we are working on for the 3.0 major version." + "\n\n" + "Another big feature will be a NodeGraph that will allow you create and visualize the UI flow.", width - 16); QUI.Space(3); DrawArticle("Thank You", "We would like to thank everyone that bought DoozyUI and helped us get this far." + "\n\n" + "We have even bigger plans for the system and we are glad to have your support. " + "Should you have any suggestions or find any bugs (or solutions) please let us know so that we can improve the system for you and anyone that uses it." + "\n\n" + "Thanks!" + "\n" + "Doozy Entertainment", width - 16); }
void DrawTrigger() // 3D触碰后消失 { QUI.SetGUIBackgroundColor(QColors.PurpleLight.Color); QUI.BeginHorizontal(WIDTH_420); { XiaoShiType(); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.despawnAfter = (PoolyDespawner.DespawnAfter)despawnAfter.enumValueIndex; } } } QUI.FlexibleSpace(); if (!orDespawnAfterTime.boolValue) { QUI.BeginChangeCheck(); QUI.Toggle(orDespawnAfterTime); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.orDespawnAfterTime = orDespawnAfterTime.boolValue; } } } QUI.Label("延时", Style.Text.Normal, 50); } else { QUI.BeginChangeCheck(); QUI.Toggle(orDespawnAfterTime); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.orDespawnAfterTime = orDespawnAfterTime.boolValue; } } } QUI.Label("延时", Style.Text.Normal, 30); QUI.BeginChangeCheck(); QUI.PropertyField(duration, 40); if (duration.floatValue <= 0) { duration.floatValue = 0; } if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.duration = duration.floatValue; } } } QUI.Label("秒", Style.Text.Normal, 50); } } QUI.EndHorizontal(); QUI.ResetColors(); infoMessage["duration.floatValue"].show.target = duration.floatValue <= 0 && orDespawnAfterTime.boolValue; DrawInfoMessage("duration.floatValue", WIDTH_420); QUI.SetGUIBackgroundColor(accentColorPurple); QUI.BeginHorizontal(WIDTH_420); { QUI.Label("接触后,“消失”在那调用:", Style.Text.Normal, 138); QUI.Space(SPACE_8); QUI.BeginChangeCheck(); QUI.Toggle(despawnOnTriggerEnter); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.despawnOnTriggerEnter = despawnOnTriggerEnter.boolValue; } } } QUI.Label("Enter", Style.Text.Normal, 34); QUI.Space(SPACE_8); QUI.BeginChangeCheck(); QUI.Toggle(despawnOnTriggerStay); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.despawnOnTriggerStay = despawnOnTriggerStay.boolValue; } } } QUI.Label("Stay", Style.Text.Normal, 28); QUI.Space(SPACE_8); QUI.BeginChangeCheck(); QUI.Toggle(despawnOnTriggerExit); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.despawnOnTriggerExit = despawnOnTriggerExit.boolValue; } } } QUI.Label("Exit", Style.Text.Normal, 24); QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.Space(SPACE_4); QUI.BeginHorizontal(WIDTH_420); { QUI.PropertyField(onlyWithTag, 12); QUI.Label("仅和 tag 碰撞", Style.Text.Normal, 120); QUI.BeginChangeCheck(); targetTag.stringValue = EditorGUILayout.TagField(targetTag.stringValue); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.targetTag = targetTag.stringValue; } } } QUI.Space(SPACE_4); } QUI.EndHorizontal(); QUI.ResetColors(); }
void DrawControlPanelSpportFor3RdPartyAssets(float width) { QUI.DrawTexture(DUIResources.pageControlPanelSeparatorSupport.texture, 242, 16); QUI.Space(2); #region Playmaker if (EditorApplication.isCompiling) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorIsCompiling.texture, 242, 40); } else if (EditorApplication.isPlayingOrWillChangePlaymode) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorInPlayMode.texture, 242, 40); } else { QUI.BeginHorizontal(width); { #if dUI_PlayMaker if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonPlaymakerEnabled), 200, 40)) { NotificationWindow.YesNo("Disable support for PlayMaker?", "This will remove '" + DUI.SYMBOL_PLAYMAKER + "' from Scripting Define Symbols in Player Settings.", () => { QUtils.RemoveScriptingDefineSymbol(DUI.SYMBOL_PLAYMAKER); }, null); } #else if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonPlaymakerDisabled), 200, 40)) { NotificationWindow.YesNo("Enable support for PlayMaker?", "Enable this only if you have PlayMaker already installed." + "\n\n" + "This will add '" + DUI.SYMBOL_PLAYMAKER + "' to Scripting Define Symbols in Player Settings.", () => { QUtils.AddScriptingDefineSymbol(DUI.SYMBOL_PLAYMAKER); }, null); } #endif QUI.Space(2); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonExternalLink), 40, 40)) { Application.OpenURL("https://www.assetstore.unity3d.com/en/#!/content/368"); } } QUI.EndHorizontal(); #endregion } QUI.Space(2); #region Master Audio if (EditorApplication.isCompiling) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorIsCompiling.texture, 242, 40); } else if (EditorApplication.isPlayingOrWillChangePlaymode) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorInPlayMode.texture, 242, 40); } else { QUI.BeginHorizontal(width); { #if dUI_MasterAudio if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonMasterAudioEnabled), 200, 40)) { NotificationWindow.YesNo("Disable support for Master Audio?", "This will remove '" + DUI.SYMBOL_MASTER_AUDIO + "' from Scripting Define Symbols in Player Settings.", () => { QUtils.RemoveScriptingDefineSymbol(DUI.SYMBOL_MASTER_AUDIO); }, null); } #else if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonMasterAudioDisabled), 200, 40)) { NotificationWindow.YesNo("Enable support for Master Audio?", "Enable this only if you have Master Audio already installed." + "\n\n" + "This will add '" + DUI.SYMBOL_MASTER_AUDIO + "' to Scripting Define Symbols in Player Settings.", () => { QUtils.AddScriptingDefineSymbol(DUI.SYMBOL_MASTER_AUDIO); }, null); } #endif QUI.Space(2); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonExternalLink), 40, 40)) { Application.OpenURL("https://www.assetstore.unity3d.com/en/#!/content/5607"); } } QUI.EndHorizontal(); } #endregion QUI.Space(2); #region Energy Bar Toolkit if (EditorApplication.isCompiling) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorIsCompiling.texture, 242, 40); } else if (EditorApplication.isPlayingOrWillChangePlaymode) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorInPlayMode.texture, 242, 40); } else { QUI.BeginHorizontal(width); { #if dUI_EnergyBarToolkit if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonEnergyBarToolkitEnabled), 200, 40)) { NotificationWindow.YesNo("Disable support for Energy Bar Toolkit?", "This will remove '" + DUI.SYMBOL_ENERGY_BAR_TOOLKIT + "' from Scripting Define Symbols in Player Settings.", () => { QUtils.RemoveScriptingDefineSymbol(DUI.SYMBOL_ENERGY_BAR_TOOLKIT); }, null); } #else if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonEnergyBarToolkitDisabled), 200, 40)) { NotificationWindow.YesNo("Enable support for Energy Bar Toolkit?", "Enable this only if you have Energy Bar Toolkit already installed." + "\n\n" + "This will add '" + DUI.SYMBOL_ENERGY_BAR_TOOLKIT + "' to Scripting Define Symbols in Player Settings.", () => { QUtils.AddScriptingDefineSymbol(DUI.SYMBOL_ENERGY_BAR_TOOLKIT); }, null); } #endif QUI.Space(2); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonExternalLink), 40, 40)) { Application.OpenURL("https://www.assetstore.unity3d.com/en/#!/content/7515"); } } QUI.EndHorizontal(); } #endregion }
protected override void DrawLeft() { tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : "设计原则"; if (QUI.Button(tempLabel, EZStyles.GetStyle(type == EType.YuanZe ? EZStyles.General.SideButtonSelected8 : EZStyles.General.SideButton8), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.YuanZe); } MyCreate.Text("创建型"); tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : "工厂模式"; if (QUI.Button(tempLabel, EZStyles.GetStyle(type == EType.Create1 ? EZStyles.General.SideButtonSelected1 : EZStyles.General.SideButton1), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.Create1); } tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : "建造者模式"; if (QUI.Button(tempLabel, EZStyles.GetStyle(type == EType.Create3 ? EZStyles.General.SideButtonSelected1 : EZStyles.General.SideButton1), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.Create3); } tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : "创建其他"; if (QUI.Button(tempLabel, EZStyles.GetStyle(type == EType.Create4 ? EZStyles.General.SideButtonSelected1 : EZStyles.General.SideButton1), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.Create4); } AddSpace_3(); MyCreate.Text("结构型"); tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : "装饰模式"; if (QUI.Button(tempLabel, EZStyles.GetStyle(type == EType.JieGuo1 ? EZStyles.General.SideButtonSelected2 : EZStyles.General.SideButton2), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.JieGuo1); } tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : "结构其他"; if (QUI.Button(tempLabel, EZStyles.GetStyle(type == EType.JieGuo2 ? EZStyles.General.SideButtonSelected2 : EZStyles.General.SideButton2), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.JieGuo2); } AddSpace_3(); MyCreate.Text("行为型"); tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : "策略模式"; if (QUI.Button(tempLabel, EZStyles.GetStyle(type == EType.XingWei1 ? EZStyles.General.SideButtonSelected3 : EZStyles.General.SideButton3), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.XingWei1); } tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : "观察者模式"; if (QUI.Button(tempLabel, EZStyles.GetStyle(type == EType.XingWei2 ? EZStyles.General.SideButtonSelected3 : EZStyles.General.SideButton3), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.XingWei2); } tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : "状态模式"; if (QUI.Button(tempLabel, EZStyles.GetStyle(type == EType.XingWei3 ? EZStyles.General.SideButtonSelected3 : EZStyles.General.SideButton3), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.XingWei3); } tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : "职责链模式"; if (QUI.Button(tempLabel, EZStyles.GetStyle(type == EType.XingWei4 ? EZStyles.General.SideButtonSelected3 : EZStyles.General.SideButton3), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.XingWei4); } tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : "行为其他"; if (QUI.Button(tempLabel, EZStyles.GetStyle(type == EType.XingWei5 ? EZStyles.General.SideButtonSelected3 : EZStyles.General.SideButton3), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.XingWei5); } }
void DrawTargetCanvas(float width) { QUI.BeginHorizontal(width); { tempFloat = width - 72; //background width QUI.Box(QStyles.GetBackgroundStyle(Style.BackgroundType.Low, QColors.Color.Gray), tempFloat, 20); QUI.Space(-tempFloat); QUI.Space(SPACE_4); QLabel.text = "Canvas Name"; QLabel.style = Style.Text.Small; QUI.BeginVertical(QLabel.x, QUI.SingleLineHeight); { QUI.Space(1); QUI.Label(QLabel); } QUI.EndVertical(); if (EditorApplication.isPlayingOrWillChangePlaymode) { GUI.enabled = false; } tempFloat = width - QLabel.x - 92; //field width if (customTargetCanvasName.boolValue) { QUI.PropertyField(targetCanvasName, tempFloat); if (Event.current.isKey && (Event.current.keyCode == KeyCode.Return || Event.current.keyCode == KeyCode.Escape) && Event.current.type == EventType.KeyUp) //if the Enter or Escape key have been pressed { customTargetCanvasName.boolValue = false; } } else { ValidateCanvasName(); QUI.BeginChangeCheck(); canvasNameIndex = EditorGUILayout.Popup(canvasNameIndex, DatabaseUICanvases.ToArray(), GUILayout.Width(tempFloat)); if (QUI.EndChangeCheck()) { Undo.RecordObject(target, "UpdateCanvasName"); targetCanvasName.stringValue = DUIData.Instance.DatabaseUICanvases[canvasNameIndex]; } } QUI.Space(SPACE_4); QLabel.text = "custom"; QLabel.style = Style.Text.Normal; QUI.BeginChangeCheck(); QUI.BeginVertical(QLabel.x + 28, 18); { QUI.Space(1); QUI.QToggle("custom", customTargetCanvasName); } QUI.EndVertical(); if (QUI.EndChangeCheck()) { if (!customTargetCanvasName.boolValue) { ValidateCanvasName(); } } GUI.enabled = true; } QUI.EndHorizontal(); infoMessage["EmptyTargetCanvasName"].show.target = string.IsNullOrEmpty(targetCanvasName.stringValue); DrawInfoMessage("EmptyTargetCanvasName", width); }
void DrawNotificationItems(float width) { tempFloat = (20 + 2 + 18 * (uiNotificationManager.NotificationItems.Count + 1) + 2) * showUINotifications.faded; //background height if (showUINotifications.faded > 0.1f) { QUI.BeginHorizontal(width); { QUI.Space(4 * showUINotifications.faded); QUI.Box(QStyles.GetBackgroundStyle(Style.BackgroundType.Low, uiNotificationManager.NotificationItems.Count > 0 ? QColors.Color.Purple : QColors.Color.Gray), width - 4, tempFloat); } QUI.EndHorizontal(); QUI.Space(-tempFloat); } if (QUI.SlicedBar("UINotifications", uiNotificationManager.NotificationItems.Count > 0 ? QColors.Color.Purple : QColors.Color.Gray, showUINotifications, width, BarHeight)) { showUINotifications.target = !showUINotifications.target; } QUI.BeginHorizontal(width); { QUI.Space(8 * showUINotifications.faded); if (QUI.BeginFadeGroup(showUINotifications.faded)) { QUI.BeginVertical(width - 8); { QUI.Space(2); if (uiNotificationManager.NotificationItems.Count == 0) { QUI.BeginHorizontal(width - 8); { QLabel.text = "No UINotifications referenced... Click [+] to start..."; QLabel.style = Style.Text.Help; QUI.BeginVertical(QLabel.x, QUI.SingleLineHeight); { QUI.Label(QLabel); QUI.Space(2); } QUI.EndVertical(); QUI.FlexibleSpace(); QUI.BeginVertical(16, QUI.SingleLineHeight); { if (QUI.ButtonPlus()) { NotificationItems.InsertArrayElementAtIndex(NotificationItems.arraySize); } QUI.Space(1); } QUI.EndVertical(); QUI.Space(4); } QUI.EndHorizontal(); } else { QUI.BeginVertical(width - 8); { for (int i = 0; i < uiNotificationManager.NotificationItems.Count; i++) { QUI.BeginHorizontal(width - 8, QUI.SingleLineHeight); { if (NotificationItems.GetArrayElementAtIndex(i).FindPropertyRelative("notificationPrefab").objectReferenceValue != null) { NotificationItems.GetArrayElementAtIndex(i).FindPropertyRelative("notificationName").stringValue = NotificationItems.GetArrayElementAtIndex(i).FindPropertyRelative("notificationPrefab").objectReferenceValue.name; } else { NotificationItems.GetArrayElementAtIndex(i).FindPropertyRelative("notificationName").stringValue = "Missing Reference"; } QLabel.text = i + " - " + NotificationItems.GetArrayElementAtIndex(i).FindPropertyRelative("notificationName").stringValue; QLabel.style = Style.Text.Normal; QUI.Label(QLabel.text, Style.Text.Normal, 200); QUI.Space(2); QUI.PropertyField(NotificationItems.GetArrayElementAtIndex(i).FindPropertyRelative("notificationPrefab"), true, width - 200 - 2 - 16 - 12 - 8); if (QUI.ButtonMinus()) { Undo.RecordObject(target, "ReferncedRemoved"); uiNotificationManager.NotificationItems.RemoveAt(i); QUI.ExitGUI(); } QUI.Space(8); } QUI.EndHorizontal(); } QUI.BeginHorizontal(width - 8); { QUI.FlexibleSpace(); QUI.BeginVertical(16, QUI.SingleLineHeight); { if (QUI.ButtonPlus()) { NotificationItems.InsertArrayElementAtIndex(NotificationItems.arraySize); } QUI.Space(1); } QUI.EndVertical(); QUI.Space(4); } QUI.EndHorizontal(); } QUI.EndVertical(); QUI.Space(2); QUI.Space(4 * showUINotifications.faded); } } QUI.EndVertical(); } QUI.EndFadeGroup(); } QUI.EndHorizontal(); QUI.Space(SPACE_8); }
protected override void DrawLeft() { tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : "Frist"; if (QUI.Button(tempLabel, EZStyles.GetStyle(type == EType.Frist ? EZStyles.General.SideButtonSelected1 : EZStyles.General.SideButton1), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.Frist); } AddSpace(); #region StrangeIoc bool isSIOC = (type == EType.StrangeIoc || type == EType.StrangeIoc1); tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : "StrangeIoc"; if (QUI.Button(tempLabel, EZStyles.GetStyle(type == EType.StrangeIoc ? EZStyles.General.SideButtonSelected2 : EZStyles.General.SideButton2), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.StrangeIoc); } if (isSIOC) { tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : (type == EType.StrangeIoc1 ? " 框架图".AddBlue() : " 框架图"); if (QUI.Button(tempLabel, EZStyles.GetStyle(EZStyles.General.SideButtonBlue), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.StrangeIoc1); } } #endregion AddSpace(); tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : "全单例"; if (QUI.Button(tempLabel, EZStyles.GetStyle(type == EType.DanLi ? EZStyles.General.SideButtonSelected3 : EZStyles.General.SideButton3), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.DanLi); } AddSpace(); #region 组合系统 bool isString = (type == EType.CeJi || type == EType.CeJi1 || type == EType.CeJi2 || type == EType.CeJi3 || type == EType.CeJi4 || type == EType.CeJi5 || type == EType.CeJi6); tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : "组合系统"; if (QUI.Button(tempLabel, EZStyles.GetStyle(type == EType.CeJi ? EZStyles.General.SideButtonSelected4 : EZStyles.General.SideButton4), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.CeJi); } if (isString) { tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : (type == EType.CeJi1 ? " 角色系统".AddBlue() : " 角色系统"); if (QUI.Button(tempLabel, EZStyles.GetStyle(EZStyles.General.SideButtonBlue), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.CeJi1); } tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : (type == EType.CeJi2 ? " 技能系统".AddBlue() : " 技能系统"); if (QUI.Button(tempLabel, EZStyles.GetStyle(EZStyles.General.SideButtonBlue), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.CeJi2); } tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : (type == EType.CeJi3 ? " 关卡系统".AddBlue() : " 关卡系统"); if (QUI.Button(tempLabel, EZStyles.GetStyle(EZStyles.General.SideButtonBlue), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.CeJi3); } tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : (type == EType.CeJi4 ? " 数据控制系统".AddBlue() : " 数据控制系统"); if (QUI.Button(tempLabel, EZStyles.GetStyle(EZStyles.General.SideButtonBlue), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.CeJi4); } tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : (type == EType.CeJi5 ? " UI 系统".AddBlue() : " UI 系统"); if (QUI.Button(tempLabel, EZStyles.GetStyle(EZStyles.General.SideButtonBlue), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.CeJi5); } tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : (type == EType.CeJi6 ? " 剧情设计".AddBlue() : " 剧情设计"); if (QUI.Button(tempLabel, EZStyles.GetStyle(EZStyles.General.SideButtonBlue), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.CeJi6); } } #endregion AddSpace(); tempLabel = mWindowSettings.sidebarIsExpanded.faded < 0.6f ? "" : "GOAP"; if (QUI.Button(tempLabel, EZStyles.GetStyle(type == EType.GOAP ? EZStyles.General.SideButtonSelected5 : EZStyles.General.SideButton5), mWindowSettings.SidebarCurrentWidth, mWindowSettings.sidebarButtonHeight)) { SetTheSame(EType.GOAP); } }
void DrawTime() { QUI.SetGUIBackgroundColor(accentColorPurple); QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Despawn After", Style.Text.Normal, 86); QUI.BeginChangeCheck(); QUI.PropertyField(despawnAfter, 100); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.despawnAfter = (PoolyDespawner.DespawnAfter)despawnAfter.enumValueIndex; } } } QUI.FlexibleSpace(); QUI.Label("Auto Start", Style.Text.Normal, 60); QUI.BeginChangeCheck(); QUI.PropertyField(autoStart, 100); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.autoStart = (PoolyDespawner.AutoStart)autoStart.enumValueIndex; } } } } QUI.EndHorizontal(); QUI.BeginHorizontal(WIDTH_420); { QUI.Label("Duration", Style.Text.Normal, 52); QUI.BeginChangeCheck(); QUI.PropertyField(duration, 40); if (duration.floatValue <= 0) { duration.floatValue = 0; } if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.duration = duration.floatValue; } } } QUI.Space(SPACE_8); QUI.BeginChangeCheck(); QUI.Toggle(useRealTime); if (QUI.EndChangeCheck()) { if (serializedObject.isEditingMultipleObjects) { Undo.RecordObjects(targets, "Multiple Edit"); for (int i = 0; i < targets.Length; i++) { PoolyDespawner despawner = (PoolyDespawner)targets[i]; despawner.useRealTime = useRealTime.boolValue; } } } QUI.Label("use RealTime instead of GameTime", Style.Text.Normal); QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.ResetColors(); infoMessage["duration.floatValue"].show.target = duration.floatValue <= 0; DrawInfoMessage("duration.floatValue", WIDTH_420); }