Beispiel #1
0
        private void Setup([NotNull] GUIContent setLabel, bool selected, bool mouseovered, bool unappliedChanges, bool textClipping, [CanBeNull] GUIStyle setStyle)
        {
            Setup(setLabel);

            clipping = textClipping;

            if (setStyle == null)
            {
                style = DrawGUI.GetFoldoutStyle(selected, mouseovered, unappliedChanges, textClipping);
            }
            else
            {
                style = setStyle;
            }
        }
Beispiel #2
0
        /// <summary>
        /// Updates the prefix drawer.
        /// </summary>
        protected virtual void UpdatePrefixDrawer()
        {
            var        selected         = Selected;
            var        mouseovered      = Mouseovered;
            const bool unappliedChanges = true;
            const bool textClipping     = false;
            var        unfolded         = Unfolded;

            if (prefixLabelDrawer != null)
            {
                prefixLabelDrawer.Dispose();
            }

            labelGuiStyle = DrawGUI.GetFoldoutStyle(selected, mouseovered, unappliedChanges, textClipping);

                        #if UNITY_EDITOR && UNITY_2018_4_OR_NEWER
            var fontFromStyle = (GUIStyle)"AM MixerHeader2";
                        #else
            var fontFromStyle = InspectorPreferences.Styles.LargeLabel;
                        #endif

            labelGuiStyle.font      = fontFromStyle.font;
            labelGuiStyle.fontStyle = fontFromStyle.fontStyle;
            labelGuiStyle.fontSize  = fontFromStyle.fontSize;

            if (!labelIdleColorCached)
            {
                labelIdleColorCached = true;
                labelIdleColor       = labelGuiStyle.normal.textColor;
            }
            else
            {
                SetLabelGUIStyleColor(labelIdleColor);
            }

            labelRequiredWidth = labelGuiStyle.CalcSize(label).x + 6f;

            prefixLabelDrawer = PrefixDrawer.CreateFoldout(label, unfolded, textClipping, labelGuiStyle);
        }