public override void Initialize() { ToolName = "Edit Terrain"; _tools = new List <TT_General>(); InitializeTool(new TT_Set()); _currentTool = _tools[0]; _currentTool.OnSelected(); }
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)); }
public override void OnSelected() { _currentTool.OnSelected(); TerrainManager.Terrain.GetComponent <MeshRenderer>().enabled = true; }