You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+39-36
Original file line number
Diff line number
Diff line change
@@ -2,19 +2,17 @@
2
2
3
3
The plugin that allows you to embed a Unity project into React Native as a full-fledged component. The plugin now supports the new architecture.
4
4
5
-
6
5
> [!IMPORTANT]
7
6
> For iOS, it is no longer necessary to embed a project created with Unity. Only the built `UnityFramework` is used. It should be placed in the plugin folder at the path - `<YOUR_RN_PROJECT>/unity/builds/ios`
8
7
9
8
## Device Support:
10
9
11
-
| Platform | Supported |
12
-
| -------- | --------- |
13
-
| iOS Simulator | ❌ |
14
-
| iOS Device | ✅ |
15
-
| Android Emulator | ✅ |
16
-
| Android Device | ✅ |
17
-
10
+
| Platform | Supported |
11
+
| ---------------- | --------- |
12
+
| iOS Simulator | ❌ |
13
+
| iOS Device | ✅ |
14
+
| Android Emulator | ✅ |
15
+
| Android Device | ✅ |
18
16
19
17
# Installation
20
18
@@ -72,6 +70,7 @@ public class ButtonBehavior : MonoBehaviour
72
70
}
73
71
}
74
72
```
73
+
75
74
</details>
76
75
77
76
## Export iOS Unity Project:
@@ -91,7 +90,7 @@ After you've moved the files from the `unity` folder to your Unity project, you
91
90
92
91
1. Open your Unity project
93
92
2. Export Unity app to `<YOUR_RN_PROJECT>/unity/builds/android`
94
-
3. Remove `<intent-filter>...</intent-filter>` from ``<project_name>/unity/builds/android/unityLibrary/src/main/AndroidManifest.xml`` at unityLibrary to leave only integrated version.
93
+
3. Remove `<intent-filter>...</intent-filter>` from `<YOUR_RN_PROJECT>/unity/builds/android/unityLibrary/src/main/AndroidManifest.xml` at unityLibrary to leave only integrated version.
95
94
96
95
If you're using expo, you're done. The built-in expo plugin will handle the rest. If you're not using expo, you'll need to follow the steps below.
97
96
@@ -101,26 +100,26 @@ If you're using expo, you're done. The built-in expo plugin will handle the rest
-`style: ViewStyle` - styles the UnityView. (Won't show on Android without dimensions. Recommended to give it `flex: 1` as in the example)
181
+
- `style: ViewStyle` - styles the UnityView. (Won't show on Android without dimensions. Recommended to give it `flex:1` as in the example)
179
182
- `onUnityMessage?: (event: NativeSyntheticEvent)` - receives a message from a Unity
180
-
-`androidKeepPlayerMounted?: boolean` - if set to true, keep the player mounted even when the view that contains it has lost focus. The player will be paused on blur and resumed on focus.**ANDROID ONLY**
181
-
-`fullScreen?: boolean` - defaults to true. If set to false, will not request full screen access.**ANDROID ONLY**
183
+
- `androidKeepPlayerMounted?: boolean` - if set to true, keep the player mounted even when the view that contains it has lost focus. The player will be paused on blur and resumed on focus. **ANDROID ONLY**
184
+
- `fullScreen?: boolean` - defaults to true. If set to false, will not request full screen access. **ANDROID ONLY**
182
185
183
186
## Methods
184
187
185
188
- `postMessage(gameObject, methodName, message)` - sends a message to the Unity. **FOR IOS:** The native method of unity is used to send a message
186
-
`sendMessageToGOWithName:(const char*)goName functionName:(const char*)name message:(const char*)msg;`, more details can be found in the [documentation](https://docs.unity3d.com/2021.1/Documentation/Manual/UnityasaLibrary-iOS.html)
189
+
`sendMessageToGOWithName:(constchar*)goName functionName:(constchar*)name message:(constchar*)msg;`, more details can be found in the [documentation](https://docs.unity3d.com/2021.1/Documentation/Manual/UnityasaLibrary-iOS.html)
187
190
- `unloadUnity()` - the Unity is unloaded automatically when the react-native component is unmounted, but if you want to unload the Unity, you can call this method
188
191
- `pauseUnity?: (pause: boolean)` - pause the Unity
189
-
-`windowFocusChanged(hasFocus: boolean = false)` - simulate focus change (intended to be used to recover from black screen (not rendering) after remounting Unity view when `resumeUnity` does not work) **ANDROID ONLY**
192
+
- `windowFocusChanged(hasFocus: boolean =false)` - simulate focus change (intended to be used to recover from black screen (not rendering) after remounting Unity view when `resumeUnity` does not work) **ANDROID ONLY**
190
193
191
194
# Contributing
192
195
193
196
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
0 commit comments