示例#1
0
    void DrawFillGUI(int WindowID)
    {
        //Fill TYpe
        GUI.Label(new Rect(10, 20, 200, 20), "Select Fill Type");
        _fillListEntry = GUI.SelectionGrid(new Rect(10, 40, 200, 80), _fillListEntry, TileTypes.TerrainGUIContentList, 3);
        _fillType      = TileTypes.GetTerrainTileInfo(_fillListEntry);

        //Show fill button
        if (GUI.Button(new Rect(10, 130, 200, 40), "Fill !"))
        {
            FillBoardWithType(_fillType);
        }

        DrawGUIWindowCloseButton(ref _drawFillWindow);
        GUI.DragWindow(new Rect(0, 0, 10000, 20));
    }
示例#2
0
    void Start()
    {
        //Set default values
        _newType    = TileTypes.GetTerrainTileInfo(0);
        _changeType = TileTypes.GetTerrainTileInfo(0);
        _fillType   = TileTypes.GetTerrainTileInfo(0);
        _leftType   = TileTypes.GetTerrainTileInfo(0);
        _rightType  = TileTypes.GetTerrainTileInfo(1);

        //Fill In the icons
        _changePositionGUIContent = new GUIContent[]
        {
            new GUIContent(UL), new GUIContent(UM), new GUIContent(UR),
            new GUIContent(L), new GUIContent(M), new GUIContent(R),
            new GUIContent(LL), new GUIContent(LM), new GUIContent(LR),
        };
    }
示例#3
0
    void DrawChangeGUI(int WindowID)
    {
        //Size
        GUI.Label(new Rect(10, 20, 200, 20), "Choose New Size");

        string difCols = "";

        if (_changeNewNumCols > _boardScript.GetNumberOfColumns())
        {
            difCols += "+";
        }
        difCols += (_changeNewNumCols - _boardScript.GetNumberOfColumns());
        GUI.Label(new Rect(10, 40, 100, 20), "Cols (" + difCols + "=" + _changeNewNumCols + "):");
        _changeNewNumCols = ToMultipleOfFour(GUI.HorizontalSlider(new Rect(105, 45, 100, 20), _changeNewNumCols, _minSize, _maxSize));

        string difRows = "";

        if (_changeNewNumCols > _boardScript.GetNumberOfRows())
        {
            difRows += "+";
        }
        difRows += _changeNewNumRows - _boardScript.GetNumberOfRows();
        GUI.Label(new Rect(10, 60, 100, 20), "Rows (" + difRows + "=" + _changeNewNumRows + "):");
        _changeNewNumRows = ToMultipleOfFour(GUI.HorizontalSlider(new Rect(105, 65, 100, 20), _changeNewNumRows, _minSize, _maxSize));

        //Show change type selection
        GUI.Label(new Rect(10, 90, 200, 20), "Select Type");
        _changeTypeEntry = GUI.SelectionGrid(new Rect(10, 110, 200, 80), _changeTypeEntry, TileTypes.TerrainGUIContentList, 3);
        _changeType      = TileTypes.GetTerrainTileInfo(_changeTypeEntry);

        //Show change position selection
        GUI.Label(new Rect(10, 200, 200, 20), "Choose direction to expand to");
        _changePositionEntry = GUI.SelectionGrid(new Rect(10, 220, 100, 80), _changePositionEntry, _changePositionGUIContent, 3);

        //Show change button
        if (GUI.Button(new Rect(10, 320, 200, 40), "Change !"))
        {
            ChangeBoardSize(_changeNewNumCols, _changeNewNumRows, _changePositionEntry, _changeType);
        }

        DrawGUIWindowCloseButton(ref _drawChangeWindow);
        GUI.DragWindow(new Rect(0, 0, 10000, 20));
    }
示例#4
0
    void DrawNewGUI(int WindowID)
    {
        //Show size options
        GUI.Label(new Rect(10, 20, 200, 20), "Choose Size");
        GUI.Label(new Rect(10, 40, 70, 20), "Cols (" + _numColumns + "):");
        _numColumns = ToMultipleOfFour(GUI.HorizontalSlider(new Rect(80, 45, 125, 20), _numColumns, _minSize, _maxSize));
        GUI.Label(new Rect(10, 60, 70, 20), "Rows (" + _numRows + "):");
        _numRows = ToMultipleOfFour(GUI.HorizontalSlider(new Rect(80, 65, 125, 20), _numRows, _minSize, _maxSize));

        //Show base type selection
        GUI.Label(new Rect(10, 90, 200, 20), "Select Base Type");
        _newListEntry = GUI.SelectionGrid(new Rect(10, 110, 200, 80), _newListEntry, TileTypes.TerrainGUIContentList, 3);
        _newType      = TileTypes.GetTerrainTileInfo(_newListEntry);

        //Show new button
        if (GUI.Button(new Rect(10, 210, 200, 40), "New !"))
        {
            CreateNewBoard(_numColumns, _numRows, _newType);
        }

        DrawGUIWindowCloseButton(ref _drawNewWindow);
        GUI.DragWindow(new Rect(0, 0, 10000, 20));
    }