Question by
HHEY · Oct 18, 2017 at 12:02 PM ·
pluginnative pluginupdate function
Plugin external method every frame
Hey,
I'm calling an external method following https://docs.unity3d.com/Manual/NativePlugins.html every frame on Update (). The problem is, the native position update is not in Sync with the underlying Unity rendering. It looks like the hotspots are stuttering because they are one or more frames behind. Is that expected? Is there any way to call it synced not asynced?
[DllImport ("__Internal")]
private static extern void nativeViewUpdateHotspot(string name, float x, float y);
extern "C" {
void nativeViewUpdateHotspot(const char* name, float x, float y, float percentage, float direction, float distance) {
…
[hotspotsViewController updateHotspot:[NSString stringWithUTF8String:name]
x:CGFloat(x)
y:CGFloat(y)
];
}
}
Comment
Your answer
Follow this Question
Related Questions
Access rig joint positions in C# 0 Answers
Native android plugin stop working when changing scenes 0 Answers
Accessing Native plugin from a thread. 0 Answers