Skip to content

Commit 8763e5c

Browse files
committed
Fix failing to export images in new unity versions
1 parent a8239c1 commit 8763e5c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

RuntimeUnityEditor/Utils/TextureUtils.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static byte[] BasedEncodeToPNG(this Texture tex)
5454
var t = Type.GetType("UnityEngine.ImageConversion, UnityEngine.ImageConversionModule", false);
5555
var m2 = t?.GetMethod("EncodeToPNG", BindingFlags.Static | BindingFlags.Public);
5656
if (m2 != null)
57-
return (byte[])m2.Invoke(t2d, new object[0]);
57+
return (byte[])m2.Invoke(null, new object[] { t2d });
5858

5959
throw new Exception("Could not find method EncodeToPNG, can't save to file.");
6060
}

0 commit comments

Comments
 (0)