参考文档:unity 图片旋转(180度翻转)_unity翻转图片-优快云博客
Texture2D Rotate180(Texture2D tex)
{
int width = tex.width;
int height = tex.height;
Texture2D newTexture = new Texture2D(width, height);
for (int i = 0; i < width; i++)
{
for (int j = 0; j < height; j++)
{
Color color = tex.GetPixel(i, j);
newTexture.SetPixel(width - i, height - j, color);
}
}
newTexture.Apply();
return newTexture;
}
其他文档:
Unity Texture2D的裁剪、镜像、翻转、缩放、合并、分辨率_unity texture2d只合并不透明像素-优快云博客