hi, macy here happy holidays! i hope you guys enjoyed your christmas and the new year is coming. in this upcoming year,
Android zipalign, i will be releasing a game on the google cardboard!
i am very excited that google actually starts selling the cardboard on the play store and also it released an sdk that supports unity. it means a lot for game developers. the most important part is it actually opened a store
just for vr games. in this video, i will be showing you how to run the demo unity game example on your google cardboard. of course, you will need a cardboard viewer and a device that works with google cardboard.
let's get it started. first, we need to go to the developers.google.com/cardboard here, just click the developer overview. you will see the cardboard sdk for unity. that's what we are getting
for our unity project. just click on that. it will take you to a github repostory. download and samples go to the main directory cope this link and open your terminal(command line) i will just go to the folder i wanted
cd documents and then projects i will just clone it here git clone and just paste the url we just copied don't direct download it
from here because it will not give you the complete project. here it is completed. let's open unity. now, i am in unity. just click file, new project i just find the directory where i downloaded the project.
projects/ cardboard-unity let's just save it in the same folder. save it as "project". click create project. this process will generate a new empty project for me.
then we have to import our assets into this project. just click assets import packages custom packages let's go to projects click this packages we just downloaded. open it.
there are a lot of files. just import them all. you will see everything is imported. the plugin is for android in here, there are all the special files to make it working click on the cardboard folder click on the demoscene double click on the demoscene
you can see here it is the demo you can click on the play button, see if it is running or not. ok, everything seems fine. we will test it on a real phone. we need to make a build on our device in order to test it out. let's click on file
click on build settings choose android click on player settings there are 2 things we need to change. in other settings, we need to change the bundle identifier. com.companyname .appname that's for this.
we need to change the orientation. landscape left(corrected) then, we need to add current. if you are in this demoscene.unity just click add current then this will be the first scene being loaded in unity. what you need to make sure is
open your terminal(command line) make sure your android phone is connected and turned on debug mode with your computer just type adb devices so my device is attached that should be fine just click on build and run
go to save it in the correct folder just name it android.apk save this will going through the build process. some of you may running into build errors. since android sdk has changed it's structures a a couple of times. i had a problem with zipalign tools missing
what i did was in the tools folder i just copied and pasted the zipalign tool from the latest sdk version. go to build tools, go to 21.1.1 and then you will find your zipalign tool
just copy this and paste it in your tools folder this will fix some of your build errors. just keep in mind that if there is any build error that is not your problem that's just the structure of android sdk has been changed and unity hasn't been able
to adopt it in their in certain versions of unity. let's try the demo. so we will see a 3d space. we can look around. the lens will move with you as well. all we need to do is finding the cube. it is here. pull the trigger.
disappeared. let's try again. oh, it's right here. this is very cool. let's try one more time. that one was really far. :p i hope this will be a good example for your project
to get started. in next video, i will come out with a game idea and we will start from there. see you next video! bye! let's open it. pretty cool animation. we just need to put that
do exactly what it says put into my cardboard. you can already see here has a like 2 sides of screens
with same animation this creates an illusion of 3d. just put it in.