Ejemplo n.º 1
0
    /// <summary>
    /// Adds texture based on textureID to uvs list
    /// </summary>
    private void AddTexture(int textureID)
    {
        float y = textureID / BlockData.NumberOfTextures;
        float x = textureID - (y * BlockData.NumberOfTextures);

        x *= BlockData.GetBlockTextureSize();
        y *= BlockData.GetBlockTextureSize();

        y = 1f - y - BlockData.GetBlockTextureSize();

        uvs.Add(new Vector2(x, y));
        uvs.Add(new Vector2(x, y + BlockData.GetBlockTextureSize()));
        uvs.Add(new Vector2(x + BlockData.GetBlockTextureSize(), y));
        uvs.Add(new Vector2(x + BlockData.GetBlockTextureSize(), y + BlockData.GetBlockTextureSize()));
    }