SamboyCoding / Cpp2IL

Work-in-progress tool to reverse unity's IL2CPP toolchain.
MIT License
1.56k stars 178 forks source link

Invalid interface method implementations #310

Open thegu5 opened 4 days ago

thegu5 commented 4 days ago

This was already mentioned in #cpp2il-support, I'm making this issue for organization.

example: image image The method in the interface is public, but the method in the implementing class is private, causing the type to be invalid

Method 'OnBeforeSerialize' in type 'UnityEngine.Events.UnityEvent`1' from assembly 'UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

(this specific example's error is because UnityEvent`1 extends UnityEventBase which implements ISerializationCallbackReceiver, and it doesn't see the method impl in UnityEventBase)

https://github.com/Unity-Technologies/UnityCsReference/blob/c4a2a4d90d91496bf3d4602778223a0e660c2a56/Runtime/Export/UnityEvent/UnityEvent.cs#L743