【问题标题】:how to integrate unity in React native?如何在 React Native 中集成统一?
【发布时间】:2023-03-28 02:09:01
【问题描述】:

这是否可以将 Unity(游戏引擎)与 React Native 集成/配置并开发基于游戏的应用程序?如果是,你能告诉我程序/架构是什么吗?谢谢

【问题讨论】:

  • 如果 Unity 已经有自己的跨平台解决方案,为什么还要尝试将 Unity 与 React Native 集成?
  • 应用将有几个功能,其中一个是基于unity3d的游戏,应用的其余部分将基于RN构建
  • 找到解决办法了吗?

标签: ios reactjs unity3d react-native


【解决方案1】:

您可以在 RN 应用程序中嵌入 WebGL 组件。然后从某个服务器加载游戏构建。

react-unity-webgl 可以在这里提供帮助。

这几行的内容

//constructor
this.unityContent = new UnityContent(
  "<YOUR_BUILD_FILE>",
  "<YOUR_UNITY_LOADER_FILE>"
);

//render
render() {
    return <Unity unityContent={this.unityContent} />;
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-09-16
    • 2018-12-08
    • 2020-12-29
    • 2020-10-30
    • 2019-05-01
    • 1970-01-01
    • 2019-06-16
    相关资源
    最近更新 更多