Esempio n. 1
0
        public override void OnInspectorGUI()
        {
            UpdateIds();
            UpdateLists();
            base.OnInspectorGUI();
            serializedObject.Update();
            DrawHeader(Styles.GetStyle(Styles.StyleName.ComponentHeaderSpriteTargetImage), MenuUtils.SpriteTargetImage_Manual, MenuUtils.SpriteTargetImage_YouTube);
            GUILayout.Space(DGUI.Properties.Space(2));
            DGUI.Property.Draw(m_image, UILabels.Image, HasReference ? ComponentColorName : ColorName.Red);
            GUILayout.Space(DGUI.Properties.Space(4));
            int themeIndex = Database.GetThemeIndex(Target.ThemeId);

            if (themeIndex != -1)
            {
                ThemeTargetEditorUtils.DrawThemePopup(Database, m_theme, ThemesNames, themeIndex, ComponentColorName, serializedObject, targets, Target, InitialGUIColor, UpdateIds, UpdateLists);
                GUILayout.Space(DGUI.Properties.Space());
                ThemeTargetEditorUtils.DrawActiveVariant(m_theme, ComponentColorName);
            }

            GUILayout.Space(DGUI.Properties.Space(2));
            int propertyIndex = m_theme.GetSpritePropertyIndex(Target.PropertyId);

            if (Target.PropertyId == Guid.Empty || propertyIndex == -1)
            {
                ThemeTargetEditorUtils.DrawLabelNoPropertyFound();
            }
            else
            {
                ThemeTargetEditorUtils.DrawSpriteProperties(m_theme, propertyIndex, serializedObject, targets, Target, ComponentColorName, InitialGUIColor);
            }
            GUILayout.Space(DGUI.Properties.Space(4));
            serializedObject.ApplyModifiedProperties();
        }
Esempio n. 2
0
        public override void OnInspectorGUI()
        {
            UpdateIds();
            UpdateLists();
            base.OnInspectorGUI();
            serializedObject.Update();
            DrawHeader(Styles.GetStyle(Styles.StyleName.ComponentHeaderColorTargetUnityEvent), MenuUtils.ColorTargetUnityEvent_Manual, MenuUtils.ColorTargetUnityEvent_YouTube);
            GUILayout.Space(DGUI.Properties.Space(2));
            DGUI.Property.UnityEvent(m_event, UILabels.Event, ComponentColorName, Target.Event.GetPersistentEventCount());
            GUILayout.Space(DGUI.Properties.Space(4));
            int themeIndex = Database.GetThemeIndex(Target.ThemeId);

            if (themeIndex != -1)
            {
                ThemeTargetEditorUtils.DrawThemePopup(Database, m_theme, ThemesNames, themeIndex, ComponentColorName, serializedObject, targets, Target, InitialGUIColor, UpdateIds, UpdateLists);
                GUILayout.Space(DGUI.Properties.Space());
                ThemeTargetEditorUtils.DrawActiveVariant(m_theme, ComponentColorName);
            }

            GUILayout.Space(DGUI.Properties.Space(2));
            int propertyIndex = m_theme.GetColorPropertyIndex(Target.PropertyId);

            if (Target.PropertyId == Guid.Empty || propertyIndex == -1)
            {
                ThemeTargetEditorUtils.DrawLabelNoPropertyFound();
            }
            else
            {
                ThemeTargetEditorUtils.DrawColorProperties(m_theme, propertyIndex, serializedObject, targets, Target, InitialGUIColor);
            }
            GUILayout.Space(DGUI.Properties.Space(4));
            serializedObject.ApplyModifiedProperties();
        }
Esempio n. 3
0
        public override void OnInspectorGUI()
        {
            UpdateIds();
            UpdateLists();
            base.OnInspectorGUI();
            serializedObject.Update();
            DrawHeader(Styles.GetStyle(Styles.StyleName.ComponentHeaderColorTargetParticleSystem), MenuUtils.ColorTargetParticleSystem_Manual, MenuUtils.ColorTargetParticleSystem_YouTube);
            GUILayout.Space(DGUI.Properties.Space(2));
            DGUI.Property.Draw(m_particleSystem, UILabels.ParticleSystem, HasReference ? ComponentColorName : ColorName.Red);
            GUILayout.Space(DGUI.Properties.Space());
            ThemeTargetEditorUtils.DrawOverrideAlpha(m_overrideAlpha, m_alpha, Target.ParticleSystem == null ? 1 : Target.ParticleSystem.main.startColor.color.a, ComponentColorName, InitialGUIColor);
            GUILayout.Space(DGUI.Properties.Space(4));
            int themeIndex = Database.GetThemeIndex(Target.ThemeId);

            if (themeIndex != -1)
            {
                ThemeTargetEditorUtils.DrawThemePopup(Database, m_theme, ThemesNames, themeIndex, ComponentColorName, serializedObject, targets, Target, InitialGUIColor, UpdateIds, UpdateLists);
                GUILayout.Space(DGUI.Properties.Space());
                ThemeTargetEditorUtils.DrawActiveVariant(m_theme, ComponentColorName);
            }

            GUILayout.Space(DGUI.Properties.Space(2));
            int propertyIndex = m_theme.GetColorPropertyIndex(Target.PropertyId);

            if (Target.PropertyId == Guid.Empty || propertyIndex == -1)
            {
                ThemeTargetEditorUtils.DrawLabelNoPropertyFound();
            }
            else
            {
                ThemeTargetEditorUtils.DrawColorProperties(m_theme, propertyIndex, serializedObject, targets, Target, InitialGUIColor);
            }
            GUILayout.Space(DGUI.Properties.Space(4));
            serializedObject.ApplyModifiedProperties();
        }
Esempio n. 4
0
        private void DrawPropertyIndex(Guid id, SelectionState selectionState, AnimBool animBool)
        {
            GUILayout.Space(DGUI.Properties.Space(2));
            var propertyIndex    = m_theme.GetColorPropertyIndex(id);
            var propertyNotFound = id == Guid.Empty || propertyIndex == -1;

            GUILayout.BeginHorizontal();
            {
                if (!propertyNotFound && !animBool.target)
                {
                    GUI.color = m_theme.ActiveVariant.Colors[propertyIndex].Color;
                    GUILayout.Label(GUIContent.none, Styles.GetStyle(Styles.StyleName.ColorButtonSelected));
                    GUI.color = InitialGUIColor;
                    GUILayout.Space(2);
                }

                DGUI.Bar.Draw(selectionState.ToString(), Size.L, DGUI.Bar.Caret.CaretType.Caret, ComponentColorName, animBool);
            }
            GUILayout.EndHorizontal();

            if (DGUI.FoldOut.Begin(animBool))
            {
                GUILayout.Space(DGUI.Properties.Space(2));
                if (propertyNotFound)
                {
                    ThemeTargetEditorUtils.DrawLabelNoPropertyFound();
                }
                else
                {
                    DrawColorProperties(m_theme, propertyIndex, selectionState);
                }
            }

            DGUI.FoldOut.End(animBool);
        }
        private void DrawPropertyIndex(Guid id, ThemeTargetEditorUtils.SelectionState selectionState, AnimBool animBool)
        {
            GUILayout.Space(DGUI.Properties.Space(2));
            int  propertyIndex    = m_theme.GetSpritePropertyIndex(id);
            bool propertyNotFound = id == Guid.Empty || propertyIndex == -1;

            DGUI.Bar.Draw(selectionState + (propertyNotFound
                                              ? ""
                                              : ": " + m_theme.SpriteLabels[propertyIndex].Label),
                          Size.L, DGUI.Bar.Caret.CaretType.Caret, ComponentColorName, animBool);

            if (DGUI.FoldOut.Begin(animBool))
            {
                GUILayout.Space(DGUI.Properties.Space(2));
                if (propertyNotFound)
                {
                    ThemeTargetEditorUtils.DrawLabelNoPropertyFound();
                }
                else
                {
                    DrawSpriteProperties(m_theme, propertyIndex, selectionState);
                }
            }

            DGUI.FoldOut.End(animBool);
        }
Esempio n. 6
0
        public override void OnInspectorGUI()
        {
#if dUI_TextMeshPro
            UpdateIds();
            UpdateLists();
#endif
            base.OnInspectorGUI();
            serializedObject.Update();
            DrawHeader(Styles.GetStyle(Styles.StyleName.ComponentHeaderColorTargetTextMeshPro), MenuUtils.ColorTargetTextMeshPro_Manual, MenuUtils.ColorTargetTextMeshPro_YouTube);
            GUILayout.Space(DGUI.Properties.Space(2));

#if dUI_TextMeshPro
            DGUI.Property.Draw(m_textMeshPro, UILabels.TextMeshPro, HasReference ? ComponentColorName : ColorName.Red);
            GUILayout.Space(DGUI.Properties.Space());
            ThemeTargetEditorUtils.DrawOverrideAlpha(m_overrideAlpha, m_alpha, Target.TextMeshPro == null ? 1 : Target.TextMeshPro.color.a, ComponentColorName, InitialGUIColor);
            GUILayout.Space(DGUI.Properties.Space(4));
            int themeIndex = Database.GetThemeIndex(Target.ThemeId);
            if (themeIndex != -1)
            {
                ThemeTargetEditorUtils.DrawThemePopup(Database, m_theme, ThemesNames, themeIndex, ComponentColorName, serializedObject, targets, Target, InitialGUIColor, UpdateIds, UpdateLists);
                GUILayout.Space(DGUI.Properties.Space());
                ThemeTargetEditorUtils.DrawActiveVariant(m_theme, ComponentColorName);
            }

            GUILayout.Space(DGUI.Properties.Space(2));
            int propertyIndex = m_theme.GetColorPropertyIndex(Target.PropertyId);
            if (Target.PropertyId == Guid.Empty || propertyIndex == -1)
            {
                ThemeTargetEditorUtils.DrawLabelNoPropertyFound();
            }
            else
            {
                ThemeTargetEditorUtils.DrawColorProperties(m_theme, propertyIndex, serializedObject, targets, Target, InitialGUIColor);
            }
#else
            GetInfoMessage(SUPPORT_FOR_TEXT_MESH_PRO_NOT_ENABLED).Draw(true, InspectorWidth);
#endif

            GUILayout.Space(DGUI.Properties.Space(4));
            serializedObject.ApplyModifiedProperties();
        }