Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Native plugin IUnityEventQueue

Discussion in 'Documentation' started by DAVco, Mar 3, 2017.

  1. DAVco


    May 27, 2013
    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?
  2. holo-krzysztof


    Apr 5, 2017
    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?
  3. jpvanoosten


    Nov 20, 2009
    I am also wondering about this...

    5 years later...