Overview
The react-native-unity-view allows integration of Unity3D within a React Native app, enabling the display of Unity content on both iOS and Android platforms. It is a React Native component that facilitates the showcasing of Unity projects, offering compatibility with Unity versions 2019.3 and newer.
Features
- Integration: Seamlessly integrate Unity3D projects within React Native apps.
- Cross-Platform: Works on both iOS and Android platforms.
- Compatibility: Supports Unity versions 2019.3 and newer.
- Configurability: Allows for custom configurations for Unity project placements and settings.
- Export Options: Facilitates exporting Unity projects for Android and iOS platforms.
- Support: Provides UnityMessageManager support for communication between Unity and React Native.
Installation
To install the react-native-unity-view, run the following command:
yarn add @asmadsen/react-native-unity-view
Configuration:
- Place Build.cs and XCodePostBuild.cs scripts in unity//Assets/Scripts/Editor/.
- Configure Unity by setting Player settings, Android settings, and iOS settings as mentioned in the documentation.
- Export Unity project using ReactNative => Export Android or ReactNative => Export iOS.
Native Build Configuration:
- For Android: Add required lines to android/settings.gradle and android/build.gradle.
- For iOS: Add the exported Unity project to the iOS workspace and set the Target Membership to UnityFramework.
Summary
The react-native-unity-view is a valuable tool that enables React Native developers to seamlessly integrate Unity3D content within their applications. With support for both iOS and Android platforms, and compatibility with newer Unity versions, this component offers a flexible solution for showcasing Unity projects. By following the installation and configuration instructions provided, developers can easily incorporate Unity content in their React Native apps.