void DrawRenameGameObjectButton()
 {
     if (!DUI.DUISettings.UIEffect_Inspector_ShowButtonRenameGameObject || (uiEffect.targetUIElement != null && uiEffect.targetUIElement.linkedToNotification))
     {
         return;
     }
     QUI.Space(SPACE_2);
     QUI.BeginHorizontal(WIDTH_420);
     {
         if (QUI.Button("Rename GameObject to target Element Name"))
         {
             if (serializedObject.isEditingMultipleObjects)
             {
                 Undo.RecordObjects(targets, "Renamed Multiple Objects");
                 for (int i = 0; i < targets.Length; i++)
                 {
                     UIEffect iTarget = (UIEffect)targets[i];
                     iTarget.gameObject.name = iTarget.targetUIElement != null
                                               ? (DUI.DUISettings.UIEffect_Inspector_RenameGameObjectPrefix + iTarget.targetUIElement.elementName + DUI.DUISettings.UIEffect_Inspector_RenameGameObjectSuffix)
                                               : "UIEffect DISABLED";
                 }
             }
             else
             {
             }
             RenameGameObject();
         }
     }
     QUI.EndHorizontal();
 }
 void DrawRenameGameObjectButton(float width)
 {
     QUI.BeginHorizontal(width);
     {
         if (QUI.GhostButton("Rename GameObject", QColors.Color.Gray, width, 18))
         {
             if (serializedObject.isEditingMultipleObjects)
             {
                 Undo.RecordObjects(targets, "Rename");
                 for (int i = 0; i < targets.Length; i++)
                 {
                     UIEffect iTarget = (UIEffect)targets[i];
                     iTarget.gameObject.name = iTarget.targetUIElement != null
                                               ? (DUI.DUISettings.UIEffect_Inspector_RenameGameObjectPrefix + iTarget.targetUIElement.elementName + DUI.DUISettings.UIEffect_Inspector_RenameGameObjectSuffix)
                                               : "UIEffect DISABLED";
                 }
             }
             else
             {
                 RenameGameObject();
             }
         }
     }
     QUI.EndHorizontal();
 }
Ejemplo n.º 3
0
 static void GetUIEffectsReferences()
 {
     if (!DUI.DUISettings.HierarchyManager_UIEffect_Enabled)
     {
         return;
     }
     uiEffectIDs.Clear();
     for (int i = 0; i < allTheGameObjectsInScene.Length; i++)
     {
         uief = null;
         uief = allTheGameObjectsInScene[i].GetComponent <UIEffect>();
         if (uief == null)
         {
             continue;
         }
         uiEffectIDs.Add(allTheGameObjectsInScene[i].GetInstanceID(), uief);
     }
 }
        static void HierarchyCustomizer(int instanceID, Rect selectionRect)
        {
            if (!DUI.DUISettings.HierarchyManager_Enabled)
            {
                return;
            }

            string label      = "";
            float  labelWidth = 0;

            Rect rect = new Rect(selectionRect);

            rect.x      = rect.xMax - iconWidth;
            rect.width  = iconWidth;
            rect.height = iconHeight;

#if dUI_PlayMaker
            if (DUI.DUISettings.HierarchyManager_PlaymakerEventDispatcher_ShowIcon && playmakerEventDispatcherIDs.ContainsKey(instanceID) && playmakerEventDispatcherIDs[instanceID] != null)
            {
                GUI.Label(rect, DUIResources.iconPlayMakerEventDispatcher128x128.texture); rect.x -= iconWidth;
            }
#endif
            if (DUI.DUISettings.HierarchyManager_UITrigger_ShowIcon && uiTriggerIDs.ContainsKey(instanceID) && uiTriggerIDs[instanceID] != null)
            {
                GUI.Label(rect, DUIResources.iconUITrigger128x128.texture); rect.x -= iconWidth;
            }
            if (DUI.DUISettings.HierarchyManager_UIManager_ShowIcon && UIManagerID == instanceID)
            {
                GUI.Label(rect, DUIResources.iconUIManager128x128.texture); rect.x -= iconWidth;
            }
            if (DUI.DUISettings.HierarchyManager_Soundy_ShowIcon && SoundyID == instanceID)
            {
                GUI.Label(rect, DUIResources.iconSoundy128x128.texture); rect.x -= iconWidth;
            }
            if (DUI.DUISettings.HierarchyManager_UINotificationManager_ShowIcon && UINotificationManagerID == instanceID)
            {
                GUI.Label(rect, DUIResources.iconUINotificationManager128x128.texture); rect.x -= iconWidth;
            }
            if (DUI.DUISettings.HierarchyManager_OrientationManager_ShowIcon && OrientationManagerID == instanceID)
            {
                GUI.Label(rect, DUIResources.iconOrientationManager128x128.texture); rect.x -= iconWidth;
            }
            if (DUI.DUISettings.HierarchyManager_SceneLoader_ShowIcon && SceneLoaderID == instanceID)
            {
                GUI.Label(rect, DUIResources.iconSceneLoader128x128.texture); rect.x -= iconWidth;
            }

            if (DUI.DUISettings.HierarchyManager_UICanvas_Enabled && uiCanvasIDs.ContainsKey(instanceID) && uiCanvasIDs[instanceID] != null)
            {
                if (DUI.DUISettings.HierarchyManager_UICanvas_ShowIcon)
                {
                    GUI.Label(rect, DUIResources.iconUICanvas128x128.texture);
                }
                else
                {
                    rect.x += iconWidth;
                }
                UICanvas uic = uiCanvasIDs[instanceID];
                label = "";
                label = (DUI.DUISettings.HierarchyManager_UICanvas_ShowCanvasName ? "[ " + uic.canvasName + " ]" : "")
                        + (DUI.DUISettings.HierarchyManager_UICanvas_ShowSortingLayerNameAndOrder ? " " + uic.Canvas.sortingLayerName + " " + uic.Canvas.sortingOrder : "");
                if (!string.IsNullOrEmpty(label))
                {
                    labelWidth = DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall).CalcSize(new GUIContent(label)).x;
                    rect.x    -= labelWidth;
                    rect.width = labelWidth;
                    GUI.Label(rect, label, DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall));
                }
            }

            if (DUI.DUISettings.HierarchyManager_UIButton_Enabled && uiButtonIDs.ContainsKey(instanceID) && uiButtonIDs[instanceID] != null)
            {
                if (DUI.DUISettings.HierarchyManager_UIButton_ShowIcon)
                {
                    GUI.Label(rect, DUIResources.iconUIButton128x128.texture);
                }
                else
                {
                    rect.x += iconWidth;
                }
                UIButton uib = uiButtonIDs[instanceID];
                label = "";
                label = (DUI.DUISettings.HierarchyManager_UIButton_ShowButtonCategory ? "[ " + uib.buttonCategory + " ]" : "")
                        + (DUI.DUISettings.HierarchyManager_UIButton_ShowButtonName ? "[ " + uib.buttonName + " ]" : "");
                if (!string.IsNullOrEmpty(label))
                {
                    labelWidth = DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall).CalcSize(new GUIContent(label)).x;
                    rect.x    -= labelWidth;
                    rect.width = labelWidth;
                    GUI.Label(rect, label, DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall));
                }
            }

            if (DUI.DUISettings.HierarchyManager_UINotification_ShowIcon && uiNotificationIDs.ContainsKey(instanceID))
            {
                GUI.Label(rect, DUIResources.iconUINotification128x128.texture); rect.x -= iconWidth;
            }
            if (DUI.DUISettings.HierarchyManager_UIElement_Enabled && uiElementIDs.ContainsKey(instanceID) && uiElementIDs[instanceID] != null)
            {
                if (DUI.DUISettings.HierarchyManager_UIElement_ShowIcon)
                {
                    GUI.Label(rect, DUIResources.iconUIElement128x128.texture);
                }
                else
                {
                    rect.x += iconWidth;
                }
                UIElement uie = uiElementIDs[instanceID];
                label = "";
                if (uie.linkedToNotification)
                {
                    label = "linked to notification";
                }
                else
                {
                    label = (DUI.DUISettings.HierarchyManager_UIElement_ShowElementCategory ? "[ " + uie.elementCategory + " ]" : "")
                            + (DUI.DUISettings.HierarchyManager_UIElement_ShowElementName ? "[ " + uie.elementName + " ]" : "")
                            + (DUI.DUISettings.HierarchyManager_UIElement_ShowSortingLayerNameAndOrder ? " " + uie.Canvas.sortingLayerName + " " + uie.Canvas.sortingOrder : "");
                }
                if (!string.IsNullOrEmpty(label))
                {
                    labelWidth = DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall).CalcSize(new GUIContent(label)).x;
                    rect.x    -= labelWidth;
                    rect.width = labelWidth;
                    GUI.Label(rect, label, DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall));
                }
            }

            if (DUI.DUISettings.HierarchyManager_UIEffect_Enabled && uiEffectIDs.ContainsKey(instanceID) && uiEffectIDs[instanceID] != null)
            {
                if (DUI.DUISettings.HierarchyManager_UIEffect_ShowIcon)
                {
                    GUI.Label(rect, DUIResources.iconUIEffect128x128.texture);
                }
                else
                {
                    rect.x += iconWidth;
                }
                UIEffect uie = uiEffectIDs[instanceID];
                if (DUI.DUISettings.HierarchyManager_UIEffect_ShowSortingLayerNameAndOrder)
                {
                    if (uie.targetUIElement != null)
                    {
                        if (uie.targetUIElement.linkedToNotification)
                        {
                            label = "linked to notification";
                        }
                        else
                        {
                            label = (uie.useCustomSortingLayerName
                                     ? uie.customSortingLayerName
                                     : uie.targetUIElement.Canvas.overrideSorting
                                       ? uie.targetUIElement.Canvas.sortingLayerName
                                       : uie.targetUIElement.Canvas.rootCanvas.sortingLayerName)
                                    + " " +
                                    (uie.useCustomOrderInLayer
                                     ? uie.customOrderInLayer
                                     : uie.targetUIElement.Canvas.overrideSorting
                                       ? uie.targetUIElement.Canvas.sortingOrder
                                       : uie.targetUIElement.Canvas.rootCanvas.sortingOrder);
                        }
                    }
                    else
                    {
                        label = "DISABLED";
                    }
                    labelWidth = DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall).CalcSize(new GUIContent(label)).x;
                    rect.x    -= labelWidth;
                    rect.width = labelWidth;
                    GUI.Label(rect, label, DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall));
                }
            }
        }
Ejemplo n.º 5
0
        static void HierarchyCustomizer(int instanceID, Rect selectionRect)
        {
            if (DUI.DUISettings == null || !DUI.DUISettings.HierarchyManager_Enabled)
            {
                return;
            }

            QLabel = new QLabel("", Style.Text.Small);

            rect        = new Rect(selectionRect);
            rect.x      = rect.xMax - iconWidth;
            rect.width  = iconWidth;
            rect.height = iconHeight;

#if dUI_PlayMaker
            if (DUI.DUISettings.HierarchyManager_PlaymakerEventDispatcher_ShowIcon && playmakerEventDispatcherIDs.ContainsKey(instanceID) && playmakerEventDispatcherIDs[instanceID] != null)
            {
                GUI.Label(rect, DUIResources.iconPlayMakerEventDispatcher.texture); rect.x -= iconWidth;
            }
#endif
            if (DUI.DUISettings.HierarchyManager_UITrigger_ShowIcon && uiTriggerIDs.ContainsKey(instanceID) && uiTriggerIDs[instanceID] != null)
            {
                GUI.Label(rect, DUIResources.iconUITrigger.texture); rect.x -= iconWidth;
            }
            if (DUI.DUISettings.HierarchyManager_UIManager_ShowIcon && UIManagerID == instanceID)
            {
                GUI.Label(rect, DUIResources.iconUIManager.texture); rect.x -= iconWidth;
            }
            if (DUI.DUISettings.HierarchyManager_Soundy_ShowIcon && SoundyID == instanceID)
            {
                GUI.Label(rect, DUIResources.iconSoundy.texture); rect.x -= iconWidth;
            }
            if (DUI.DUISettings.HierarchyManager_UINotificationManager_ShowIcon && UINotificationManagerID == instanceID)
            {
                GUI.Label(rect, DUIResources.iconUINotificationManager.texture); rect.x -= iconWidth;
            }
            if (DUI.DUISettings.HierarchyManager_OrientationManager_ShowIcon && OrientationManagerID == instanceID)
            {
                GUI.Label(rect, DUIResources.iconOrientationManager.texture); rect.x -= iconWidth;
            }
            if (DUI.DUISettings.HierarchyManager_SceneLoader_ShowIcon && SceneLoaderID == instanceID)
            {
                GUI.Label(rect, DUIResources.iconSceneLoader.texture); rect.x -= iconWidth;
            }

            if (DUI.DUISettings.HierarchyManager_UICanvas_Enabled && uiCanvasIDs.ContainsKey(instanceID) && uiCanvasIDs[instanceID] != null)
            {
                if (DUI.DUISettings.HierarchyManager_UICanvas_ShowIcon)
                {
                    GUI.Label(rect, DUIResources.iconUICanvas.texture);
                }
                else
                {
                    rect.x += iconWidth;
                }
                uic          = uiCanvasIDs[instanceID];
                QLabel.text  = "";
                QLabel.style = Style.Text.Small;
                QLabel.text  = (DUI.DUISettings.HierarchyManager_UICanvas_ShowCanvasName ? "[ " + uic.canvasName + " ]" : "")
                               + (DUI.DUISettings.HierarchyManager_UICanvas_ShowSortingLayerNameAndOrder ? " " + uic.Canvas.sortingLayerName + " " + uic.Canvas.sortingOrder : "");
                if (!string.IsNullOrEmpty(QLabel.text))
                {
                    rect.x    -= QLabel.x;
                    rect.width = QLabel.x;
                    GUI.Label(rect, QLabel.text, QStyles.GetStyle(QStyles.GetStyleName(QLabel.style)));
                }
            }

            if (DUI.DUISettings.HierarchyManager_UIButton_Enabled && uiButtonIDs.ContainsKey(instanceID) && uiButtonIDs[instanceID] != null)
            {
                if (DUI.DUISettings.HierarchyManager_UIButton_ShowIcon)
                {
                    GUI.Label(rect, DUIResources.iconUIButton.texture);
                }
                else
                {
                    rect.x += iconWidth;
                }
                uib          = uiButtonIDs[instanceID];
                QLabel.text  = "";
                QLabel.style = Style.Text.Small;
                QLabel.text  = (DUI.DUISettings.HierarchyManager_UIButton_ShowButtonCategory ? "[ " + uib.buttonCategory + " ]" : "")
                               + (DUI.DUISettings.HierarchyManager_UIButton_ShowButtonName ? "[ " + uib.buttonName + " ]" : "");
                if (!string.IsNullOrEmpty(QLabel.text))
                {
                    rect.x    -= QLabel.x;
                    rect.width = QLabel.x;
                    GUI.Label(rect, QLabel.text, QStyles.GetStyle(QStyles.GetStyleName(QLabel.style)));
                }
            }

            if (DUI.DUISettings.HierarchyManager_UINotification_ShowIcon && uiNotificationIDs.ContainsKey(instanceID))
            {
                GUI.Label(rect, DUIResources.iconUINotification.texture); rect.x -= iconWidth;
            }
            if (DUI.DUISettings.HierarchyManager_UIElement_Enabled && uiElementIDs.ContainsKey(instanceID) && uiElementIDs[instanceID] != null)
            {
                if (DUI.DUISettings.HierarchyManager_UIElement_ShowIcon)
                {
                    GUI.Label(rect, DUIResources.iconUIElement.texture);
                }
                else
                {
                    rect.x += iconWidth;
                }
                uie          = uiElementIDs[instanceID];
                QLabel.text  = "";
                QLabel.style = Style.Text.Small;
                if (uie.linkedToNotification)
                {
                    QLabel.text = "linked to notification";
                }
                else
                {
                    QLabel.text = (DUI.DUISettings.HierarchyManager_UIElement_ShowElementCategory ? "[ " + uie.elementCategory + " ]" : "")
                                  + (DUI.DUISettings.HierarchyManager_UIElement_ShowElementName ? "[ " + uie.elementName + " ]" : "")
                                  + (DUI.DUISettings.HierarchyManager_UIElement_ShowSortingLayerNameAndOrder ? " " + uie.Canvas.sortingLayerName + " " + uie.Canvas.sortingOrder : "");
                }
                if (!string.IsNullOrEmpty(QLabel.text))
                {
                    rect.x    -= QLabel.x;
                    rect.width = QLabel.x;
                    GUI.Label(rect, QLabel.text, QStyles.GetStyle(QStyles.GetStyleName(QLabel.style)));
                }
            }

            if (DUI.DUISettings.HierarchyManager_UIEffect_Enabled && uiEffectIDs.ContainsKey(instanceID) && uiEffectIDs[instanceID] != null)
            {
                if (DUI.DUISettings.HierarchyManager_UIEffect_ShowIcon)
                {
                    GUI.Label(rect, DUIResources.iconUIEffect.texture);
                }
                else
                {
                    rect.x += iconWidth;
                }
                uief = uiEffectIDs[instanceID];
                if (DUI.DUISettings.HierarchyManager_UIEffect_ShowSortingLayerNameAndOrder)
                {
                    if (uief.targetUIElement != null)
                    {
                        if (uief.targetUIElement.linkedToNotification)
                        {
                            QLabel.text = "linked to notification";
                        }
                        else
                        {
                            QLabel.text = (uief.useCustomSortingLayerName
                                     ? uief.customSortingLayerName
                                     : uief.targetUIElement.Canvas.overrideSorting
                                       ? uief.targetUIElement.Canvas.sortingLayerName
                                       : uief.targetUIElement.Canvas.rootCanvas.sortingLayerName)
                                          + " " +
                                          (uief.useCustomOrderInLayer
                                     ? uief.customOrderInLayer
                                     : uief.targetUIElement.Canvas.overrideSorting
                                       ? uief.targetUIElement.Canvas.sortingOrder
                                       : uief.targetUIElement.Canvas.rootCanvas.sortingOrder);
                        }
                    }
                    else
                    {
                        QLabel.text = "DISABLED";
                    }
                    rect.x    -= QLabel.x;
                    rect.width = QLabel.x;
                    GUI.Label(rect, QLabel.text, QStyles.GetStyle(QStyles.GetStyleName(QLabel.style)));
                }
            }
        }