Update ImageConversionUnstrip.cs

This commit is contained in:
Sinai 2020-11-14 02:49:14 +11:00 committed by GitHub
parent 60580c8183
commit 755eae293e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,20 +19,6 @@ namespace UnityExplorer.Unstrip
.Invoke(tex.Pointer);
return new Il2CppStructArray<byte>(ptr);
//// This is a bit of a hack. The iCall actually returns an Il2CppStructArray<byte>...
// byte[] data = ICallHelper.GetICall<d_EncodeToPNG>("UnityEngine.ImageConversion::EncodeToPNG")
// .Invoke(tex.Pointer);
//// However, if you try to use that result with for example File.WriteAllBytes, it won't work.
//// Simple fix: iterate into a new managed array.
//byte[] safeData = new byte[data.Length];
//for (int i = 0; i < data.Length; i++)
// safeData[i] = (byte)data[i];
//return safeData;
}
// bool ImageConversion.LoadImage(this Texture2D tex, byte[] data, bool markNonReadable);
@ -66,4 +52,4 @@ namespace UnityExplorer.Unstrip
}
}
#endif
#endif