How can I place Unity WebGL in my React Native app?

后端 未结 3 820
面向向阳花
面向向阳花 2021-02-18 22:39

I have written a simple React Native app using WebGL. I used https://github.com/JilvanPinheiro/reactive-native-unity-webgl



        
3条回答
  •  借酒劲吻你
    2021-02-18 23:15

    Simplest way:

    1. Go to the index.html file for your react project.

    2. Add Script tag for the Unity WebGL loader:

    3. Script for instantiating Unity(you can also use one of your components in react for this):

    4. A

      tag, which has an id that is used in the instantiation function.

    5. Do not display it until you have reached the component path that you desired with react. When you are in the path Mywebsite/myUnityProject use the ID of the

      to select and change the display mode to visible.

    I hope that helped !

提交回复
热议问题