public void OnMouseUp(BaseHexCell hexCell, bool leftMouse) { TerrainLayer grassLayer = hexCell.HexTerrain.TerrainLayers[1]; grassLayer.ApplyValue(hexCell.X, hexCell.Y, leftMouse); // hexCell.HexTerrain.Redraw(); }
internal void OnMouse(BaseHexCell hexCell, bool leftMouse) { currentBrushStrategy.OnMouse(brushCells, leftMouse); hexTerrain.DoRepositionCells(); foreach (BaseHexCell c in redrawCells) { c.Redraw(); } }
public void OnMouse(BaseHexCell hexCell, bool leftMouse) { int h = MapEditor.Instance.prevCurrentHexCell.height; // h = hexCell.height; h = targetHeight; if (leftMouse) { h++; } else { h--; } hexCell.HexTerrain.HeightMap.ApplyHeight(hexCell.X, hexCell.Y, h); }
public void OnMouse(List <BaseHexCell> brushCells, bool leftMouse) { if (!prevCenterCell) { prevCenterCell = MapEditor.Instance.prevCurrentHexCell; targetHeight = prevCenterCell.height; } //if (Instance.brushCells.Contains(prevHexCell)) //{ // return; //} //prevHexCell = MapEditor.Instance.prevCurrentHexCell; foreach (BaseHexCell c in brushCells) { OnMouse(c, leftMouse); } }
private List <BaseHexCell> GetTempBrushCells(BaseHexCell hexCell) { if (prevBrush == BrushSize && prevCurrentHexCell == hexCell) { return(brushCells); } brushCells.Clear(); brushCells.Add(hexCell); FillContainerWithNeighbors(brushCells, BrushSize - 1); redrawCells.Clear(); brushCells.ForEach(x => redrawCells.Add(x)); FillContainerWithNeighbors(redrawCells, 1); List <BaseHexCell> container = brushCells; prevBrush = this.BrushSize; prevCurrentHexCell = hexCell; return(container); }
public void OnMouseUp(BaseHexCell hexCell, bool leftMouse) { print("None brush selected"); }
public void OnMouseDown(BaseHexCell hexCell, bool leftMouse) { }
public void OnMouse(BaseHexCell hexCell, bool leftMouse) { OnMouseUp(hexCell, leftMouse); }
public void OnMouseFree() { prevCenterCell = null; }