I have a native Android service running in the background that needs to interface with a Unity3D script.
I’m aware of the following method:
com.unity3d.player.UnityPlayer.UnitySendMessage(String gameObject, String arg1, String arg2)
But it requires a gameObject parameter. Since the service is running in the background, I can’t be 100% sure that a gameObject attached to a particular scene has not yet been destroyed. Is this a fair assumption (since the user might not even be in the app)?
If so, is there a way to instantiate a gameObject that is never destroyed? Is there any other way to call a unity script from native Java code?