Exemplo n.º 1
0
 public static Color GetPixel(this Texture2D texture, Pixel pixel)
 {
     return(texture.GetPixel(pixel.X, pixel.Y));
 }
Exemplo n.º 2
0
        public static Color GetPixel(this Texture2D texture, Vector2 uv)
        {
            Pixel coord = texture.UVToPixel(uv);

            return(texture.GetPixel(coord));
        }
Exemplo n.º 3
0
        public static void SetPixel(this Texture2D texture, Vector2 uv, Color color)
        {
            Pixel coord = texture.UVToPixel(uv);

            texture.SetPixel(coord, color);
        }
Exemplo n.º 4
0
 public static void SetPixel(this Texture2D texture, Pixel pixel, Color color)
 {
     texture.SetPixel(pixel.X, pixel.Y, color);
 }
Exemplo n.º 5
0
 /// <summary>
 /// 像素坐标转换为UV坐标;
 /// </summary>
 public static Vector2 PixelToUV(this Texture2D texture, Pixel pixel)
 {
     return(TexCoordConvert.ToUV(pixel, texture.width, texture.height));
 }