コード例 #1
0
 public static void addColor(ColorVariable ColorVariable)
 {
     if (!ColorOptions.ColorDict.ContainsKey(ColorVariable.identity))
     {
         ColorOptions.ColorDict.Add(ColorVariable.identity, ColorVariable);
     }
 }
コード例 #2
0
 public ColorVariable(ColorVariable option)
 {
     identity     = option.identity;
     name         = option.name;
     color        = option.color;
     origColor    = option.origColor;
     disableAlpha = option.disableAlpha;
 }
コード例 #3
0
        public static bool ColorButton(float width, ColorVariable color, float height = 25, params GUILayoutOption[] options)
        {
            List <GUILayoutOption> parameters = options.ToList();

            parameters.Add(GUILayout.Height(height));
            parameters.Add(GUILayout.Width(width));
            Rect area = GUILayoutUtility.GetRect(width, height, parameters.ToArray());

            Drawing.DrawRect(area, MenuComponent._OutlineBorderBlack);
            Rect preview = new Rect(area.x + 4, area.y + 4, area.height - 8, area.height - 8);
            bool pressed = GUI.Button(MenuUtilities.Inline(area), "      " + color.name, _ButtonStyle);

            Drawing.DrawRect(preview, MenuComponent._OutlineBorderBlack);
            Drawing.DrawRect(MenuUtilities.Inline(preview), MenuComponent._OutlineBorderLightGray);
            Drawing.DrawRect(MenuUtilities.Inline(preview, 2), color.color);
            return(pressed);
        }