예제 #1
0
    public override void Initialize()
    {
        ToolName = "Edit Terrain";
        _tools   = new List <TT_General>();

        InitializeTool(new TT_Set());
        _currentTool = _tools[0];
        _currentTool.OnSelected();
    }
예제 #2
0
    public override void UpdateGUI(Rect guiRect)
    {
        int i = 0;

        //draw button for every tool
        foreach (var tool in _tools)
        {
            if (GUI.Button(new Rect(5 + (i % 3) * 20, 22 * (i++ / 3) + 120, 30, 20), tool.ToolName))
            {
                _currentTool.OnDeselected();
                _currentTool = tool;
                _currentTool.OnSelected();
            }
        }
        _currentTool.UpdateGUI(new Rect(guiRect.x, guiRect.y + 60, guiRect.width, guiRect.height - 60));
    }
예제 #3
0
 public override void OnSelected()
 {
     _currentTool.OnSelected();
     TerrainManager.Terrain.GetComponent <MeshRenderer>().enabled = true;
 }