示例#1
0
        protected override WindowedMap <FlatTriPoint> CreateWindowedMap()
        {
            WindowedMap <FlatTriPoint> windowedHexMap;

            float   cellWidth;
            float   cellHeight;
            Vector2 cellDimensions;

            switch (mapType)
            {
            case MapType.Tri:
                cellWidth      = CellPrefab.Dimensions.y / 69 * 80;
                cellHeight     = CellPrefab.Dimensions.y;
                cellDimensions = new Vector2(cellWidth, cellHeight);

                windowedHexMap = new FlatTriMap(cellDimensions.HadamardMul(CellSpacingFactor))
                                 .WithWindow(centerRect);
                break;

            case MapType.Custom:
                windowedHexMap = GetCustomMap();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(windowedHexMap);
        }
        protected override WindowedMap <FlatTriPoint> CreateWindowedMap()
        {
            WindowedMap <FlatTriPoint> windowedHexMap;

            switch (mapType)
            {
            case MapType.Tri:
                windowedHexMap = new FlatTriMap(cellPrefab.Dimensions)
                                 .WithWindow(centerRect);
                break;

            case MapType.Custom:
                windowedHexMap = GetCustomMap();
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }

            return(windowedHexMap);
        }