Example #1
0
 protected override void Awake()
 {
     base.Awake();
     TilesetHelper = new TilesetHelper(TileSize, TilesetSize);
     BlockModelGenerator.PrepareGenerator(TilesetHelper);
     PreviewProvider = new BlockPreviewProvider(PreviewGenerator);
 }
Example #2
0
 public static void AddPlaneInv(GeneratableMesh meshInfo, Vector3[] verts, TilesetHelper helper, Byte2 tile, Vector3 rootPos, int pointer, Color32 color)
 {
     meshInfo.AddVerticesWithPos(verts, rootPos);
     meshInfo.AddTriangles(_planeTrisInverted, pointer);
     meshInfo.AddPlaneUVs(tile);
     //Ага
     meshInfo.Colors.Add(color);
     meshInfo.Colors.Add(color);
     meshInfo.Colors.Add(color);
     meshInfo.Colors.Add(color);
 }
Example #3
0
        public static void PrepareGenerator(TilesetHelper helper)
        {
            _helper = helper;
            var tileCount = helper.TileCount;
            var width     = helper.TilesetWidthTiles;

            _fullTileCacheWidth = width;
            _fullTileUVCache    = new Vector2[tileCount][];
            for (byte x = 0; x < width; x++)
            {
                for (byte y = 0; y < width; y++)
                {
                    _fullTileUVCache[x + width * y] = CacheUVsForTile(new Byte2(x, y));
                }
            }
        }