Beispiel #1
0
        private void OnGUI()
        {
            _scrollPos = EditorGUILayout.BeginScrollView(_scrollPos);
            FuzzyTools.uniformChangeColors =
                EditorGUILayout.Toggle(UniformChange, FuzzyTools.uniformChangeColors);
            FuzzyHelper.SetEditorPrefBool(EditorPrefUniform, FuzzyTools.uniformChangeColors);

            if (FuzzyTools.uniformChangeColors)
            {
                _skinDefault  = EditorGUILayout.ColorField(BackGroundColor, _skinDefault);
                _fontDefault  = EditorGUILayout.ColorField(FontColor, _fontDefault);
                _styleDefault = (FontStyle)EditorGUILayout.EnumPopup(FontStyleName, _styleDefault);
            }


            for (var i = 0; i < _selectedGameObjs.Length; i++)
            {
                if (!FuzzyTools.uniformChangeColors)
                {
                    EditorGUILayout.LabelField(_selectedGameObjs[i].name);
                    _backgroundColors[i] = EditorGUILayout.ColorField(BackGroundColor, _backgroundColors[i]);
                    _fontColors[i]       = EditorGUILayout.ColorField(FontColor, _fontColors[i]);
                    _fontStyles[i]       = (FontStyle)EditorGUILayout.EnumPopup(FontStyleName, _fontStyles[i]);
                }
                else
                {
                    _backgroundColors[i] = _skinDefault;
                    _fontColors[i]       = _fontDefault;
                    _fontStyles[i]       = _styleDefault;
                }

                var customObjs    = _inSceneTracker.customizedObjs;
                var customOptions = _inSceneTracker.options;
                var options       = new HierarchyOptions()
                {
                    backgroundColor = _backgroundColors[i],
                    fontColor       = _fontColors[i],
                    style           = _fontStyles[i]
                };

                if (customObjs.Contains(_selectedGameObjs[i]))
                {
                    var index = customObjs.IndexOf(_selectedGameObjs[i]);
                    customOptions[index] = options;
                }
                else
                {
                    customObjs.Add(_selectedGameObjs[i]);
                    customOptions.Add(options);
                }

                EditorGUILayout.Separator();
            }

            EditorGUILayout.EndScrollView();
        }
Beispiel #2
0
        private static void GetPreferences()
        {
            FuzzyTools.inActiveColor = EditorGUIUtility.isProSkin ? DefaultSkin : DefaultProSkin;
            FuzzyTools.PrimaryColor  = EditorGUIUtility.isProSkin ? DefaultProSkin : DefaultSkin;
            FuzzyTools.colorMode     =
                (CustomColorType)FuzzyHelper.GetEditorPrefInt(ColorMode, (int)FuzzyTools.colorMode);
            FuzzyTools.gameObjectFontColor =
                FuzzyHelper.GetEditorPrefColor(GoFontColor, FuzzyTools.gameObjectFontColor);
            FuzzyTools.prefabOrgFontColor =
                FuzzyHelper.GetEditorPrefColor(PrefFontColor, FuzzyTools.prefabOrgFontColor);
            FuzzyTools.inActiveColor     = FuzzyHelper.GetEditorPrefColor(InactiveColor, FuzzyTools.inActiveColor);
            FuzzyTools.inActiveFontColor =
                FuzzyHelper.GetEditorPrefColor(InactiveFontColor, FuzzyTools.inActiveFontColor);
            FuzzyTools.standardFont =
                (FontStyle)FuzzyHelper.GetEditorPrefInt(StandardFont, (int)FuzzyTools.standardFont);
            FuzzyTools.prefebFont       = (FontStyle)FuzzyHelper.GetEditorPrefInt(PrefabFont, (int)FuzzyTools.prefebFont);
            FuzzyTools.autoInvertColors =
                FuzzyHelper.GetEditorPrefBool(AutoInvert, FuzzyTools.autoInvertColors);
            FuzzyTools.hierarchyColor1     = FuzzyHelper.GetEditorPrefColor(HierarchyColor1, FuzzyTools.hierarchyColor1);
            FuzzyTools.hierarchyColor2     = FuzzyHelper.GetEditorPrefColor(HierarchyColor2, FuzzyTools.hierarchyColor2);
            FuzzyTools.hierarchyColor3     = FuzzyHelper.GetEditorPrefColor(HierarchyColor3, FuzzyTools.hierarchyColor3);
            FuzzyTools.hierarchyColor4     = FuzzyHelper.GetEditorPrefColor(HierarchyColor4, FuzzyTools.hierarchyColor4);
            FuzzyTools.hierarchyColor5     = FuzzyHelper.GetEditorPrefColor(HierarchyColor5, FuzzyTools.hierarchyColor5);
            FuzzyTools.PrimaryColor        = FuzzyHelper.GetEditorPrefColor(PrimaryColor, FuzzyTools.PrimaryColor);
            FuzzyTools.secondaryColor      = FuzzyHelper.GetEditorPrefColor(SecondaryColor, FuzzyTools.secondaryColor);
            FuzzyTools.uniformChangeColors =
                FuzzyHelper.GetEditorPrefBool(UniformChange, FuzzyTools.uniformChangeColors);

            sceneTracker = Object.FindObjectOfType <InSceneTracker>();
            if (sceneTracker != null && FuzzyTools.colorMode != CustomColorType.CustomColors)
            {
                return;
            }
            var sceneTrackerObj = new GameObject(TrackerName, typeof(InSceneTracker))
            {
                hideFlags = HideFlags.HideInHierarchy,
                tag       = EditorOnly
            };

            sceneTracker = sceneTrackerObj.GetComponent <InSceneTracker>();
        }