mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-16 22:27:45 +08:00
Update ImageConversionUnstrip.cs
This commit is contained in:
parent
60580c8183
commit
755eae293e
@ -19,20 +19,6 @@ namespace UnityExplorer.Unstrip
|
|||||||
.Invoke(tex.Pointer);
|
.Invoke(tex.Pointer);
|
||||||
|
|
||||||
return new Il2CppStructArray<byte>(ptr);
|
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);
|
// bool ImageConversion.LoadImage(this Texture2D tex, byte[] data, bool markNonReadable);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user