I am writing a native C++ plugin for my Unity application and I am finding it necessary to send information back to managed code and perform some action on the 'main' Unity thread. Currently, I achieve this by registering a callback to managed code in my unmanaged dll which is triggered at the appropriate point and the results are picked up on the main thread during the 'update' loop. I have noticed the IUnityEventQueue.h file in the Unity Plugin API interfaces which, from the comments in the file, seems to suggest I can use it to do what I want (issue an event that is then picked up on the Unity main thread). However, I can't seem to find any examples or documentation which show this being done - the example in the file itself only (vaguely) shows communication between plugins. Does there exist any further documentation or examples showing Unmanaged->Managed communication using the IUnityEventQueue?
I'd also be interested in this - if there's any possibility to subscribe to those events directly from the managed side without having to pass delegates to native code? @DAVco, did you find a solution, by any chance?