mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-15 13:57:31 +08:00
Update ImageConversionUnstrip.cs
This commit is contained in:
parent
60580c8183
commit
755eae293e
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user