示例#1
0
        public static HexData CreateFromHex(HexCoordinates hex)
        {
            var data = new HexData()
            {
                hex = hex,
            };

            return(data);
        }
示例#2
0
        public void CreateHexDatas()
        {
            if (rowGridNum <= 0 || colGridNum <= 0)
            {
                return;
            }

            hexDatas = new HexData[rowGridNum * colGridNum];
            for (int rowIndex = 0; rowIndex < rowGridNum; rowIndex++)
            {
                for (int colIndex = 0; colIndex < colGridNum; colIndex++)
                {
                    IndexToRowCol(rowIndex, colIndex, out int row, out int col);
                    HexMetrics.OffsetToAxial(row, col, out int x, out int z);
                    this[rowIndex, colIndex] = HexData.CreateFromHex(new HexCoordinates(x, z));
                }
            }
        }