示例#1
0
        static Vector2[] CacheUVsForTile(Byte2 tilePos)
        {
            var uvs = new Vector2[4];

            for (int i = 0; i < uvs.Length; i++)
            {
                uvs[i] = _helper.RelativeToAbsolute(_fullTileUV[i].x, _fullTileUV[i].y, tilePos);
            }
            return(uvs);
        }
示例#2
0
 public static void AddPlane(GeneratableMesh meshInfo, Vector3[] verts, Byte2 tile, Vector3 rootPos, int pointer, Color32 color)
 {
     meshInfo.AddVerticesWithPos(verts, rootPos);
     meshInfo.AddTriangles(_planeTris, pointer);
     meshInfo.AddPlaneUVs(tile);
     //Ага
     meshInfo.Colors.Add(color);
     meshInfo.Colors.Add(color);
     meshInfo.Colors.Add(color);
     meshInfo.Colors.Add(color);
 }
示例#3
0
 public Vector2 RelativeToAbsolute(float u, float v, Byte2 tilePos)
 {
     return(new Vector2(_uvPerTile * u + tilePos.X * _uvPerTile, 1 - (_uvPerTile * v + tilePos.Y * _uvPerTile)));
 }
示例#4
0
 static Vector2[] GetCachedUVsForTile(Byte2 tilePos)
 {
     return(_fullTileUVCache[tilePos.X + _fullTileCacheWidth * tilePos.Y]);
 }
示例#5
0
 static void AddPlaneUVs(this GeneratableMesh meshInfo, Byte2 tilePos)
 {
     meshInfo.AddUVs(GetCachedUVsForTile(tilePos));
 }