예제 #1
0
        private void ToolsWindow(int id)
        {
            Color[] cs = new Color[preview.width * preview.height];
            for (int i = 0; i < cs.Length; i++)
            {
                cs[i] = color;
            }
            preview.SetPixels(cs);
            preview.Apply();

            if (changeKey)
            {
                Event current = Event.current;
                if (current.isKey)
                {
                    key       = current.keyCode;
                    changeKey = false;
                }
            }
            GUILayout.BeginHorizontal();
            GUILayout.BeginVertical();
            GUILayout.Label("Brush Color");
            GUILayout.Label(preview);
            GUILayout.EndVertical();
            color = ColorBlockMod.ColorField(color);
            GUILayout.EndHorizontal();

            if (GUILayout.Button("Pick color from block"))
            {
                selectingColor = true;
            }

            GUILayout.Label("Brush Radius");
            if (int.TryParse(GUILayout.TextField((radius - 1).ToString()), out int o))
            {
                radius = o + 1;
            }
            if (radius < 2)
            {
                radius = 2;
            }

            GUILayout.Label("Fixed Axis");
            selection = GUILayout.SelectionGrid(selection, axis, 3);

            GUILayout.Label("Paint Key");
            if (GUILayout.Button(changeKey ? "Press a key" : key.ToString()))
            {
                changeKey = true;
            }

            if (GUILayout.Button("Close"))
            {
                toolsVisible = false;
            }
            GUI.DragWindow();
        }
예제 #2
0
        private void ColorWindow(int id)
        {
            blockColor = ColorBlockMod.ColorField(blockColor);

            if (GUILayout.Button("Close"))
            {
                module = null;
            }
            GUI.DragWindow();
        }