
Download Links
- .gitignore file <– add to your root directory of Unity project
- lab_cardboard_assets.unitypackage <– resources for this session
Part 1: New Project + Github (~8min)
Make sure either Android Build Support or iOS Build Support is installed
- New project
- Create new Github repo. Add .gitignore to the root folder
- Why gitignore? e.g. Library directory is auto generated and can be quite large, there is no need to back this up
- Commit & Push
Part 2: Add Cardboard XR Plugin (~11min)
Source: Import plugin from Project Manager, using git
Import Plugin from Package Manager
- In Unity, go to Window > Package Manager.
- Click + and select Add package from git URL.
- Paste https://github.com/googlevr/cardboard-xr-plugin.git into the text entry field.
- The package should be added to the installed packages.
- Navigate to the Google Cardboard XR Plugin for Unity package. In the Samples section, choose Import into Project.
- The sample assets should be loaded into Assets/Samples/Google Cardboard/<version>/Hello Cardboard/Assets.
Understanding Plugin (Hierarchy, Gaze, Input)
- TrackedPoseDriver: applies the tracked device’s current rotation or position to the transform of the GameObject
- Camera as Eye & Head, GameObject as Body
- Eye: controlled by your device
- Body: controlled by you
- If you want to move Player from A to B, move Player instead of Camera
- Gaze: Use Physics.Raycast to send message to the hit object, do dynamic thing
- Input: screen touch
Part 3: Emulate in editor (~6min)
- Simulate phone rotation with mouse movement
- *** At first, push all the changes! ***
- Download lab_cardboard_assets.unitypackage
- Add VrEditorEmulator to Main Camera
- Assign Main Camera to Vr Mode Controller‘s Main Camera field on CubeRoom