Example #1
0
            public void OnMouseUp(BaseHexCell hexCell, bool leftMouse)
            {
                TerrainLayer grassLayer = hexCell.HexTerrain.TerrainLayers[1];

                grassLayer.ApplyValue(hexCell.X, hexCell.Y, leftMouse);
                //                hexCell.HexTerrain.Redraw();
            }
Example #2
0
        internal void OnMouse(BaseHexCell hexCell, bool leftMouse)
        {
            currentBrushStrategy.OnMouse(brushCells, leftMouse);

            hexTerrain.DoRepositionCells();

            foreach (BaseHexCell c in redrawCells)
            {
                c.Redraw();
            }
        }
Example #3
0
            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);
            }
Example #4
0
            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);
                }
            }
Example #5
0
        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);
        }
Example #6
0
 public void OnMouseUp(BaseHexCell hexCell, bool leftMouse)
 {
     print("None brush selected");
 }
Example #7
0
 public void OnMouseDown(BaseHexCell hexCell, bool leftMouse)
 {
 }
Example #8
0
 public void OnMouse(BaseHexCell hexCell, bool leftMouse)
 {
     OnMouseUp(hexCell, leftMouse);
 }
Example #9
0
 public void OnMouseFree()
 {
     prevCenterCell = null;
 }