ViroReact使用 React Native 的 AR 和 VR 平臺
Viro React 是一個供開發(fā)人員快速構(gòu)建增強(qiáng)現(xiàn)實(shí) (AR) 和虛擬現(xiàn)實(shí) (VR) 體驗(yàn)的平臺。開發(fā)人員使用 React Native 進(jìn)行編寫,Viro 在所有移動 VR(包括 Google Daydream、Samsung Gear VR 以及適用于 iOS 和 Android 的 Google Cardboard)和 AR(iOS ARKit 和 Android ARCore)平臺上本地運(yùn)行代碼。
手動搭建 ViroReact 平臺的說明:
構(gòu)建 iOS ViroReact:
- 按照我們的快速入門指南中的說明設(shè)置依賴項(xiàng)。
- 使用 git: 將 repo 克隆到工作區(qū)
git clone https://github.com/viromedia/viro.git。 - 使用 Virocore 存儲庫中概述的構(gòu)建說明構(gòu)建我們的 iOS 渲染器。
- 驗(yàn)證是否看到在
ios/dist文件夾中創(chuàng)建的新文件。 - 在
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 文件) - 選擇產(chǎn)品->方案。如果您沒有看到
React方案,請點(diǎn)擊Manage Schemes...。在對話框中添加React方案。 - 對 scheme 進(jìn)行構(gòu)建配置(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. - 應(yīng)該會在
ios/dist/lib/libViroReact.a中看到libViroReact.a - 要運(yùn)行 Viro React 測試,請?jiān)诓迦氲?iOS 設(shè)備上運(yùn)行
ViroExample方案。
構(gòu)建 Android Viro React:
- 在 viro 目錄下,運(yùn)行
./prepareRelease.sh. - Android bridge 現(xiàn)在應(yīng)該是在 release 下構(gòu)建
- 應(yīng)該會看到在 android/react_viro/react_viro-release.aar 中創(chuàng)建的新文件
- 構(gòu)建 android 發(fā)布測試:
$ cd test/android $ ./gradlew assembleGvrRelease - 在插入的 Android 設(shè)備上從test/android/app/build/output/gvr/app-gvr-release.apk安裝 app-gvr-release.apk。
評論
圖片
表情
