BepInEx / Il2CppInterop

A tool interoperate between CoreCLR and Il2Cpp at runtime
GNU Lesser General Public License v3.0
195 stars 61 forks source link

Ensure Proper Layout for Non-ValueTypes #57

Closed Kasuromi closed 1 year ago

Kasuromi commented 1 year ago

On some Unity versions, some types will have layout attributes assigned to them even though they are not of ValueType.

A prime example is UnityEngine.LightProbes inside UnityEngine.CoreModule.dll on 2018.4.36f1 (TestGame).

This went unnoticed for a while until we switched to CoreCLR which is way stricter in terms of type loading.

ghorsington commented 1 year ago

Looks OK to me in terms of code. Was this tested yet on some other games than just TestGame?

Kasuromi commented 1 year ago

Looks OK to me in terms of code. Was this tested yet on some other games than just TestGame?

Yes, Worked without issue on GTFO (Unity 2019.4.21f1 Win64) and Gunfire Reborn (Unity 2018.4.36f1 Win64)

I haven't tried any Win32 games, but I think it's safe to assume it will work there as well.