Now we will make a cardboard demo app.
Make a new project. Go to buildsetting and swithch platform from PC to iOS.
And in the assets, click import import cardboard sdk and demo package file.
Next, delete main camera.
And we will make a plane. Go to GameObject > 3D Object > Plane.
And I made its scale 4/1/4.
And in the ‘mesh renderer’, you can change plane’s skin.
Click the circle beside Element 0.
I selected GroundPlane. You can download other free ground plane in asset store.
Next, go to the assets > prefabs, select ‘cardboardMain’.
Drag it to the center.
And the position is 1/1/1.
And we will add a sphere.
The sphere’s position is 1/1/5.
And add a cube. (Position : 1/1/-5)
CardboardMain is parents. There’s two little different camera. It allows to look around properly.
Now let’s create ‘dots’.
In the assets, UI > prefabs > cardboardReticle.
Do not drag into the scene. Just drag it to the hierarchy inside Main Camera.
Our dots!! Nice.
We can also change the color of dots.
Next, we will add an Event System.
Add a component ‘GazeInputModule’.
And in the Main Camera, we will add a component ‘Physics 2D Raycaster’.
And inside the cube, we will add component ‘Event Trigger’.
I did it same to the sphere.
Inside the ‘Event Trigger’, click Add New Event Type. And there’s various option we can choose. We selected ‘PointerEnter’.
Next, choose function. BoxCollider > bool isTrigger.
And choose cube by clicking little circle. (Do it same with sphere.)
Now if we gaze the cube or sphere, the dot will get bigger.
And we will going to walk around to the plane.
To walk around, we have to add some code.
I downloaded from our DMC1 blog.
Inside the assets, make a new folder named ‘Scripts’.
And drag the code inside to the folder.
You can find it in the filter, or asset folder.
Set a speed, and check the box ‘Walk When Look Down’.
Now we can walk around our plane when we look down!
And when we look at our cube or sphere, the dot gets bigger.
Now we will make a moving cube.
Create a new scene. And don’t delete Main Camera.
Make a plane, and add a cube on it.
And drag ‘accelerometer’ script to the cube inspector.