예제 #1
0
            public static void Init()
            {
                if (_initialized)
                {
                    return;
                }
                _initialized = true;

                deselectedTextStyle           = new GUIStyle(EditorStyles.label);
                deselectedTextStyle.fontSize  = 13;
                deselectedTextStyle.richText  = false;
                deselectedTextStyle.alignment = TextAnchor.MiddleCenter;

                selectedTextStyle           = new GUIStyle(deselectedTextStyle);
                selectedTextStyle.fontStyle = FontStyle.Bold;

                largeButtonStyle = new GUIStyle();
                largeButtonStyle.normal.background = borderImg;
                largeButtonStyle.border            = new RectOffset(4, 4, 4, 4);

                modeTooltipStyle           = new GUIStyle();
                modeTooltipStyle.wordWrap  = true;
                modeTooltipStyle.fontSize  = 11;
                modeTooltipStyle.richText  = true;
                modeTooltipStyle.alignment = TextAnchor.UpperLeft;


                var proBg     = GlobalStyles.LoadImageResource("pkpro_selector_bg_pro");
                var defaultBg = GlobalStyles.LoadImageResource("pkpro_selector_bg");

                bgStyle = new GUIStyle();
                bgStyle.normal.background = EditorGUIUtility.isProSkin ? proBg : defaultBg;
                bgStyle.border            = new RectOffset(2, 2, 2, 2);
            }
예제 #2
0
            public static void Init()
            {
                var proBg     = GlobalStyles.LoadImageResource("pkpro_selector_bg_pro");
                var defaultBg = GlobalStyles.LoadImageResource("pkpro_selector_bg");


                if (_initialized)
                {
                    return;
                }
                _initialized = true;

                bgStyle = new GUIStyle();
                bgStyle.normal.background = EditorGUIUtility.isProSkin ? proBg : defaultBg;
                bgStyle.border            = new RectOffset(2, 2, 2, 2);

                var starEmptyTex = GlobalStyles.LoadImageResource("pkpro_rating_star_empty");
                var starFullTex  = GlobalStyles.LoadImageResource("pkpro_rating_star_filled");

                ratingStyle = new GUIStyle();
                ratingStyle.normal.background   = starEmptyTex;
                ratingStyle.onNormal.background = starFullTex;
                ratingStyle.fixedWidth          = starSize;
                ratingStyle.fixedHeight         = starSize;
                ratingStyle.padding             = new RectOffset(1, 1, 0, 0);

                starSliderStyle = new GUIStyle(GUI.skin.horizontalSlider);

                feedbackLabelStyle           = new GUIStyle(EditorStyles.label);
                feedbackLabelStyle.richText  = true;
                feedbackLabelStyle.wordWrap  = true;
                feedbackLabelStyle.alignment = TextAnchor.UpperLeft;

                feedbackTextAreaStyle         = new GUIStyle(EditorStyles.textArea);
                feedbackTextAreaStyle.margin  = EditorStyles.boldLabel.margin;
                feedbackTextAreaStyle.padding = EditorStyles.boldLabel.padding;

                feedbackPlaceholderStyle        = new GUIStyle(EditorStyles.label);
                feedbackPlaceholderStyle.margin = EditorStyles.boldLabel.margin;

                emailStyle           = new GUIStyle(EditorStyles.textField);
                emailStyle.margin    = new RectOffset(0, 0, 0, 0);
                emailStyle.alignment = TextAnchor.UpperLeft;

                submitStyle        = new GUIStyle(GUI.skin.button);
                submitStyle.margin = new RectOffset(0, 0, 0, 0);
            }
예제 #3
0
            public static void Init()
            {
                if (_initialized)
                {
                    return;
                }
                _initialized = true;

                TitleStyle        = new GUIStyle(GlobalStyles.settingsHeaderText);
                TitleStyle.margin = new RectOffset(0, 0, 0, 0);

                var proBg     = GlobalStyles.LoadImageResource("pkpro_selector_bg_pro");
                var defaultBg = GlobalStyles.LoadImageResource("pkpro_selector_bg");

                bgStyle = new GUIStyle();
                bgStyle.normal.background = EditorGUIUtility.isProSkin ? proBg : defaultBg;
                bgStyle.border            = new RectOffset(2, 2, 2, 2);

                subHeadingStyle           = new GUIStyle(EditorStyles.boldLabel);
                subHeadingStyle.alignment = TextAnchor.UpperLeft;
                subHeadingStyle.margin    = new RectOffset(0, 0, 0, 0);

                starEmptyTex = GlobalStyles.LoadImageResource("star_empty");
                starFullTex  = GlobalStyles.LoadImageResource("star_filled");

                starSliderStyle = new GUIStyle(GUI.skin.horizontalSlider);

                feedbackLabelStyle           = new GUIStyle(EditorStyles.label);
                feedbackLabelStyle.richText  = true;
                feedbackLabelStyle.wordWrap  = true;
                feedbackLabelStyle.margin    = new RectOffset(0, 0, 0, 0);
                feedbackLabelStyle.alignment = TextAnchor.UpperLeft;
                feedbackWindowStyle          = new GUIStyle(EditorStyles.textArea);
                feedbackWindowStyle.richText = true;

                EmailStyle           = new GUIStyle(EditorStyles.textField);
                EmailStyle.margin    = new RectOffset(0, 0, 0, 0);
                EmailStyle.alignment = TextAnchor.UpperLeft;

                SubmitStyle        = new GUIStyle(GUI.skin.button);
                SubmitStyle.margin = new RectOffset(0, 0, 0, 0);
            }
예제 #4
0
            public static void Init()
            {
                if (_initialized)
                {
                    return;
                }
                _initialized = true;

                blurMat      = Resources.Load <Material>("UI/blur");
                borderMat    = Resources.Load <Material>("UI/BorderMat");
                _initialized = true;

                windowStyle = new GUIStyle(GUI.skin.window)
                {
                    normal   = { background = null },
                    border   = new RectOffset(4, 4, 4, 4),
                    margin   = new RectOffset(0, 0, 0, 0),
                    richText = true
                };

                texturePlaceholder = new Texture2D(1, 1);

                if (EditorStyles.foldout != null)
                {
                    coloredFoldout = new GUIStyle(EditorStyles.foldout);
                }
                else
                {
                    coloredFoldout = new GUIStyle();
                }

                coloredFoldout.normal.textColor    = Color.white;
                coloredFoldout.hover.textColor     = Color.white;
                coloredFoldout.active.textColor    = Color.white;
                coloredFoldout.focused.textColor   = Color.white;
                coloredFoldout.active.textColor    = Color.white;
                coloredFoldout.onActive.textColor  = Color.white;
                coloredFoldout.onFocused.textColor = Color.white;
                coloredFoldout.onHover.textColor   = Color.white;
                coloredFoldout.onNormal.textColor  = Color.white;

                if (skin.button != null)
                {
                    menuOptionsStyle = new GUIStyle(skin.button);
                }
                else
                {
                    menuOptionsStyle = new GUIStyle();
                }

                menuOptionsStyle.fontSize  = 10;
                menuOptionsStyle.fontStyle = FontStyle.Bold;
                menuOptionsStyle.wordWrap  = false;
                menuOptionsStyle.clipping  = TextClipping.Overflow;
                menuOptionsStyle.margin    = new RectOffset(0, 0, 0, 0);

                notificationCloseStyle = new GUIStyle(menuOptionsStyle);
                notificationCloseStyle.normal.background = null;
                notificationCloseStyle.margin            = new RectOffset(0, 0, 0, 0);

                notificationTextStyle        = new GUIStyle(GUI.skin.label);
                notificationTextStyle.margin = new RectOffset(0, 0, 0, 0);

                var proBg     = GlobalStyles.LoadImageResource("pkpro_selector_bg_pro");
                var defaultBg = GlobalStyles.LoadImageResource("pkpro_selector_bg");

                bgStyle = new GUIStyle();
                bgStyle.normal.background = EditorGUIUtility.isProSkin ? proBg : defaultBg;
                bgStyle.border            = new RectOffset(2, 2, 2, 2);
                bgStyle.padding           = new RectOffset(32, 5, 5, 5);
                bgStyle.richText          = true;
                bgStyle.normal.textColor  = Color.white;
                bgStyle.wordWrap          = true;
            }