@dolami-inc/react-native-expo-unity 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -44,11 +44,12 @@ class UnityBridge private constructor() : IUnityPlayerLifecycleEvents, NativeCal
|
|
|
44
44
|
get() = unityPlayer != null
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* Returns the UnityPlayer
|
|
48
|
-
* Unity 6+ made UnityPlayer abstract;
|
|
47
|
+
* Returns the UnityPlayer's FrameLayout container for embedding.
|
|
48
|
+
* Unity 6+ made UnityPlayer abstract; getFrameLayout() returns the full
|
|
49
|
+
* container with the rendering surface inside it.
|
|
49
50
|
*/
|
|
50
51
|
val unityPlayerView: View?
|
|
51
|
-
get() = unityPlayer?.
|
|
52
|
+
get() = unityPlayer?.frameLayout
|
|
52
53
|
|
|
53
54
|
fun initialize(activity: Activity) {
|
|
54
55
|
if (isInitialized) return
|
|
@@ -58,6 +59,11 @@ class UnityBridge private constructor() : IUnityPlayerLifecycleEvents, NativeCal
|
|
|
58
59
|
val player = UnityPlayerForActivityOrService(activity, this)
|
|
59
60
|
unityPlayer = player
|
|
60
61
|
|
|
62
|
+
// Start Unity rendering — without these calls the player
|
|
63
|
+
// stays in a paused/unfocused state and shows a blank screen.
|
|
64
|
+
player.resume()
|
|
65
|
+
player.windowFocusChanged(true)
|
|
66
|
+
|
|
61
67
|
NativeCallProxy.registerListener(this)
|
|
62
68
|
|
|
63
69
|
Log.i(TAG, "Unity initialized")
|