예제 #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();
        }
예제 #2
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();
        }
예제 #3
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();
        }
예제 #4
0
        public override void OnInspectorGUI()
        {
            UpdateIds();
            UpdateLists();
            base.OnInspectorGUI();
            serializedObject.Update();
            DrawHeader(Styles.GetStyle(Styles.StyleName.ComponentHeaderColorTargetSelectable),
                       MenuUtils.ColorTargetSelectable_Manual, MenuUtils.ColorTargetSelectable_YouTube);
            GUILayout.Space(DGUI.Properties.Space(2));
            DGUI.Property.Draw(m_selectable, UILabels.Selectable, HasReference ? ComponentColorName : ColorName.Red);
            GUILayout.Space(DGUI.Properties.Space(4));
            var 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);
            }

            DrawPropertyIndex(Target.NormalColorPropertyId, SelectionState.Normal, m_normalAnimBool);
            DrawPropertyIndex(Target.HighlightedColorPropertyId, SelectionState.Highlighted, m_highlightedAnimBool);
            DrawPropertyIndex(Target.PressedColorPropertyId, SelectionState.Pressed, m_pressedAnimBool);
#if UNITY_2019_1_OR_NEWER
            DrawPropertyIndex(Target.SelectedColorPropertyId, SelectionState.Selected, m_selectedAnimBool);
#endif
            DrawPropertyIndex(Target.DisabledColorPropertyId, SelectionState.Disabled, m_disabledAnimBool);

            GUILayout.Space(DGUI.Properties.Space(4));
            serializedObject.ApplyModifiedProperties();
        }
예제 #5
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();
        }