- Home /
have c# code executed AFTER nativeplugin execution
Hi,
I cannot seem to have c# executed AFTER the nativeplugin execution.
I have following pseudo code:
void update()
{
cam.targetTexture = myRenderTexture;
cam.render();
cam.targetTexture = null;
}
void OnPostRender()
{
GL.IssuePluginEvent(GetFunc(), 1 );
// do some stuff AFTER native plugin execution
MyMethod();
}
The code inside MyMethod() seems to get data affected on the native plugin only for the NEXT frame, which make me believe the native plugin is executed AFTER the execution of the OnPostRender() function is complete.
My Question: Is there any way I can fence / wait or force the unity to execute it and only AFTER continue the call to the MyMethod() ??
I've tried with no luck: 1. GL.Flush() inside OnPostRender after the GL.Issue. 2. Put the GL.IssuepLuginEvent code line inisde the Update().
Would appreciate any help on matter.
regards, Idan
you could always make a coRoutine and call the coroutine ins$$anonymous$$d of just a method. It's a messy way of doing it but it should allow for the delay you're looking for.
Ienumerator $$anonymous$$y$$anonymous$$ethod() { yield return waitforseconds(1); What you want to do }
Your answer

Follow this Question
Related Questions
Low-level native plugins not working in 4.3 on Windows 3 Answers
DllNotFound when unmanaged c++ plugin library links to another unmanaged c++ library 1 Answer
Using DirectX 11 matrices in a native plugin 0 Answers
Native Rendering Plugin with UI Image 0 Answers
scan wifi using AndroidJavaObject 0 Answers