Example #1
0
        public override void OnInspectorGUI()
        {
            UpdateIds();
            UpdateLists();
            base.OnInspectorGUI();
            serializedObject.Update();
            DrawHeader(Styles.GetStyle(Styles.StyleName.ComponentHeaderColorTargetSpriteRenderer), MenuUtils.ColorTargetSpriteRenderer_Manual, MenuUtils.ColorTargetSpriteRenderer_YouTube);
            GUILayout.Space(DGUI.Properties.Space(2));
            DGUI.Property.Draw(m_spriteRenderer, UILabels.SpriteRenderer, HasReference ? ComponentColorName : ColorName.Red);
            GUILayout.Space(DGUI.Properties.Space());
            ThemeTargetEditorUtils.DrawOverrideAlpha(m_overrideAlpha, m_alpha, Target.SpriteRenderer == null ? 1 : Target.SpriteRenderer.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();
        }
Example #2
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();
        }