a basic unity project for building Google Cardboard applications for Android and iOS.
There are a few things you will need installed on your computer to make this work.
- For Android and iOS you will need Unity installed. To get Unity go to their download page and download the installer.
- You will also need the Google VR SDK for Unity. The simplest way to get this is to just download the zip file directly from here, the other option is to clone the repository using git =>
git clone https://github.com/googlevr/gvr-unity-sdk.git
NOTE: The Google VR SDK for Unity is bundled into this demo project. So it is not necessary to complete this step, but I am including it here for future reference.
Pre-Requisites for Android
- Install Java
- Install the Android SDK, the simplest way to get this is to install Android Studio.
- After installing Android Studio, you will need to update the Android SDK Tools and install an Android platform. You will need to install/update the following:
- Android SDK Build Tools
- Android SDK Platform-tools
- Android SDK Tools
- Android SDK Platform
- ARM System Images
For a more detailed explanation on what is needed go here.
Pre-Requisites for iOS
NOTE: The only way to build an application for iOS is on an Apple Computer.
- To get your application running on an iOS device you will need an AppleID. Any AppleID will work, but it is recommend that you sign up for a free developer account as well.
- To sign up for an AppleID go to this page.
- Once you have your AppleID, go to the Apple Developer Centre, click on the
Account
tab at the top of the page, and log in with your AppleID, and follow the steps to create a developer account.
- Download the latest version of Xcode from the AppStore.
- Finally you will need to add your AppleID to Xcode. Unity have a good write on how to do this here.
To get started using this project download the latest version from here.
There a couple of settings you will need to set, for both Android and iOS.
- In
PlayerSettings
, click Resolution and Presentation to expand that panel. Set the Default Orientation toAuto Rotation
, and then uncheck all of the Allowed Orientations forAuto Rotation
except forLandscape Left
. - Click Other Settings to expand that panel and find the
Bundle Identifier
field. Enter a valid package name for your application (such as com.mycompany.cardboarddemo) that follows the naming rules for Java packages and/or .Net namespaces. Typically this is of the form: com..
Building for Android
- You will need to enable developer mode on your Android device.
- Go to
Settings
>About Phone
, and then scroll down toBuild number
. You need to tapBuild number
seven (7) times. After that developer mode will be enabled.
- Go to
- You also need to enable
USB debugging
.- Go to the new
Developer options
section, and scroll down until you see theUSB debugging
toggle, switch this to on.
- Go to the new
- Plug in your Android device.
- Click build and run.
Building for iOS
- Make sure Xcode is closed. (idk why, but I had a few troubles if xcode was open)
- Plug in iOS device.
- Click build and run
This project is licensed under MIT.