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
I have successfully integrated the Gradle export of a Unity project in a React native project.
I am able to load the exported Unity module on click of a react native button as well as I can communicate with the unity module through a react native project & vice a versa.
Is there any way to add multiple gradle exports (multiple unity projects) in one react native project & achieve communication between them (one unity project / module at a time only) ?
I have tried a few things. I am not sure if it is the right way of solving this issue.
I have added 2 gradle exports of 2 different unity projects in android directory of my app
I have included path of these 2 gradle exports in android/settings.gradle file
include ':react-native-unity-view' project(':react-native-unity-view').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-unity-view/android')
include ":UnityExport" project(":UnityExport").projectDir = file("./UnityExport")
include ":UnityExport1" project(":UnityExport1").projectDir = file("./UnityExport1")
I have also added the dependency of second unity export in node_modules/react-native-unity-view/android/build.gradle file
Hey,
I have successfully integrated the Gradle export of a Unity project in a React native project.
I am able to load the exported Unity module on click of a react native button as well as I can communicate with the unity module through a react native project & vice a versa.
Is there any way to add multiple gradle exports (multiple unity projects) in one react native project & achieve communication between them (one unity project / module at a time only) ?
I have tried a few things. I am not sure if it is the right way of solving this issue.
I have added 2 gradle exports of 2 different unity projects in android directory of my app
I have included path of these 2 gradle exports in android/settings.gradle file
include ':react-native-unity-view'
project(':react-native-unity-view').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-unity-view/android')
include ":UnityExport"
project(":UnityExport").projectDir = file("./UnityExport")
include ":UnityExport1"
project(":UnityExport1").projectDir = file("./UnityExport1")
I have also added the dependency of second unity export in node_modules/react-native-unity-view/android/build.gradle file
dependencies {
compile project(':UnityExport')
compile project(':UnityExport1')
compile 'com.facebook.react:react-native:+'
}
To load unity module we generally create an instance of UnityView in our .js file
import UnityView, {UnityModule} from 'react-native-unity-view';
React.createElement(UnityView, {
style: {position: 'absolute', left: 0, right: 0, top: 0, bottom: 0},
onUnityMessage: this.onUnityMessage.bind(this),
});
Can anyone please tell me
relevant references / help / example codes is appreciated.
The text was updated successfully, but these errors were encountered: