コード例 #1
0
    private void OnGUI()
    {
        Vector3 mousepos = Camera.main.ScreenToWorldPoint(Input.mousePosition);

        switch (TOOLKIT)
        {
        case TOOLKT.BRUSH:

            break;

        case TOOLKT.EDIT:

            if (dataobj == null)
            {
                s_object obj = Grid.GetObjectFromGrid(new Vector3(mousepos.x, mousepos.y, z * Grid.GetNodeLength));
                if (obj == null)
                {
                    break;
                }
                object otype = obj.GetType();

                if (Input.GetMouseButtonDown(0))
                {
                    dataobj = obj;
                }
            }
            else
            {
                DisplayData(dataobj);
            }

            break;
        }

        z_depth        = (int)GUI.VerticalSlider(new Rect(45, 55, 150, 75), z_depth, 0, 10);
        wordsiz_temp.x = (int)GUI.HorizontalSlider(new Rect(32, 23, 150, 23), wordsiz_temp.x, 1, 45);
        wordsiz_temp.y = (int)GUI.VerticalSlider(new Rect(32, 45, 23, 150), wordsiz_temp.y, 1, 45);
        GUI.Label(new Rect(0, 0, 90, 90), "(" + wordsiz_temp.x + ", " + wordsiz_temp.y + ")" + " Z-Fill: " + z_depth);
    }