Пример #1
0
        /*
         * private void LeftToggleColorField(string label, bool value, Color color, out bool outvalue, out Color outcolor){
         *      EditorGUILayout.BeginHorizontal ();
         *
         *      Rect rect = GUILayoutUtility.GetRect (18, 18);
         *      outvalue = EditorGUI.ToggleLeft (rect, "", value);
         *
         *      outcolor = EditorGUILayout.ColorField (label, color);
         *
         *
         *
         *      EditorGUILayout.EndHorizontal ();
         * }*/



        private void ColorSettingsContents()
        {
            //   [ auto | clear ] buttone
            EditorGUILayout.BeginHorizontal();               // <b3>

            if (GUILayout.Button("Auto", EditorStyles.miniButtonLeft, miniButtonWidth))
            {
                TagsManager.AutoColor();
            }
            if (GUILayout.Button("Clear", EditorStyles.miniButtonRight, miniButtonWidth))
            {
                TagsManager.ClearTags();
            }

            EditorGUILayout.EndHorizontal();                // </b3>

            TagsManager.UpdateTags();
            string[] tags = TagsManager.Tags;
            foreach (string t in tags)
            {
                Color color = EditorGUILayout.ColorField(t, TagsManager.GetColor(t));
                TagsManager.SetColor(t, color);
            }
        }