Il2CppInterop icon indicating copy to clipboard operation
Il2CppInterop copied to clipboard

Add awaiter implementation

Open extraes opened this issue 8 months ago • 1 comments

Adds Pass61ImplementAwaiters Looks for types implementing INotifyCompletion and generates new methods that allow the interop types to implement that interface, calling the Il2CppSystem.Action -> System.Action implicit conversion before calling the original method.

This makes originally-awaitable types (e.g. UniTasks, if the game has them) awaitable again.

I previously did this in a much less automated way with Cecil in another project, but the runtime didn't like what I was doing, so I figured I'd make it less janky and add it to Il2CppInterop, and sure enough the runtime no longer rejects the type.

extraes avatar Jun 17 '24 23:06 extraes