Exemplo n.º 1
0
    public override void Initialize()
    {
        ToolName = "Edit Terrain";
        _tools   = new List <TT_General>();

        InitializeTool(new TT_Set());
        _currentTool = _tools[0];
        _currentTool.OnSelected();
    }
Exemplo n.º 2
0
 private void InitializeTool(TT_General tool)
 {
     _tools.Add(tool);
     tool.TrackManager   = TrackManager;
     tool.TileManager    = TileManager;
     tool.TerrainManager = TerrainManager;
     tool.SomePrefab     = SomePrefab;
     tool.ModelPrefab    = ModelPrefab;
     tool.Initialize();
 }
Exemplo n.º 3
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));
    }