Similar to this Stack Overflow question, I'm Building a Plugin for Android which starts a non-UnityPlayer Activity. The issue that I am running into is that UnityPlayer.UnitySendMessage does not send any messages to Unity until the Activity finishes (in which case Unity receives all of the messages at once). Is there a way to send messages to unity when UnityPlayerActivity is not the current Activity?
Asked
Active
Viewed 1,714 times
1
-
Is it possible to specify that the message will be `asynchronous` ? That way `UnityPlayer` wouldn't care if there is an activity running. – Hristo May 11 '17 at 06:10
-
I'm not sure I follow. UnityPlayer is a `View` and depends on its `Activity` (UnityPlayerActivity), so it would care if an Activity is running; the problem is when another Activity is running. – lgdroid57 May 12 '17 at 12:35
-
1I think [this](https://forum.unity3d.com/threads/android-plugin-problem.181399/) might be helpful. As the guy from `Unity Technologies` says: _When it comes to the UnityPlayer.UnitySendMessage() call, that should be ok to invoke from any thread - it is an async call that will be picked up by the Unity main thread during the next frame update._ – Hristo May 12 '17 at 12:58
-
Thanks for the link. However, I think that statement perfectly summarizes the problem. The messages are picked up by Unity, but only on Unity's next frame update (while UnityPlayerActivity is the current running Activity). Still, it makes sense that this would be the behavior, as two Activities can't run simultaneously. – lgdroid57 May 13 '17 at 00:01