void TerrainEditorUpdate() { if (!Input.GetMouseButton(0)) { return; } if (cursorInfo.transform != null && UICamera.hoveredObject == null) { tile = cursorInfo.transform.GetComponent <Tile>(); if (tile != null) { if (tile.node.terrain == null) { TerrainInstance.Create(tile.node, chosenTerrainType); //this should never be necessary. } else if (tile.node.terrain.type != chosenTerrainType) { TerrainInstance.Replace(tile.node.terrain, chosenTerrainType); } } } }
//Visibility Data public Node(TerrainType terrainType, Vector3 position) { this.position = position; Tile.Create(this); TerrainInstance.Create(this, terrainType); }