ViroReact使用 React Native 的 AR 和 VR 平台
Viro React 是一个供开发人员快速构建增强现实 (AR) 和虚拟现实 (VR) 体验的平台。开发人员使用 React Native 进行编写,Viro 在所有移动 VR(包括 Google Daydream、Samsung Gear VR 以及适用于 iOS 和 Android 的 Google Cardboard)和 AR(iOS ARKit 和 Android ARCore)平台上本地运行代码。
手动搭建 ViroReact 平台的说明:
构建 iOS ViroReact:
- 按照我们的快速入门指南中的说明设置依赖项。
 - 使用 git: 将 repo 克隆到工作区
git clone https://github.com/viromedia/viro.git。 - 使用 Virocore 存储库中概述的构建说明构建我们的 iOS 渲染器。
 - 验证是否看到在
ios/dist文件夹中创建的新文件。 - 在
ios/文件夹中安装 Pod :cd ios pod install - 在 test 文件夹中安装 node_modules: 
  
cd test npm install - 在
ViroExample文件夹中安装 pods :cd test/ios/ViroExample pod install - 在 Xcode 中打开
ViroExample.xcworkspace。(确保打开 .xcworkpace 文件,而不是* .xcodeproj 文件) - 选择产品->方案。如果您没有看到
React方案,请点击Manage Schemes...。在对话框中添加React方案。 - 对 scheme 进行构建配置(Debug 与 Release)。
 -   
  
11.a If you want the ability to run on Simulator, change target to any of the `iOS Simulator` targets instead of `Generic iOS Device`. 11.b If in your own app project setup, you prefer to include Viro React as a static library rather than relying on `use_frameworks!` - build scheme `ViroReact_static_lib` instead of `ViroReact` as mentioned above in step #11. - 应该会在
ios/dist/lib/libViroReact.a中看到libViroReact.a - 要运行 Viro React 测试,请在插入的 iOS 设备上运行
ViroExample方案。 
构建 Android Viro React:
- 在 viro 目录下,运行
./prepareRelease.sh. - Android bridge 现在应该是在 release 下构建
 - 应该会看到在 android/react_viro/react_viro-release.aar 中创建的新文件
 - 构建 android 发布测试: 
  
$ cd test/android $ ./gradlew assembleGvrRelease - 在插入的 Android 设备上从test/android/app/build/output/gvr/app-gvr-release.apk安装 app-gvr-release.apk。
 
评论
