How to create a camera that is controlled by a mobile device's in built sensors?

I’m thinking of something along the lines of Motorola’s “augmented reality” animation “Windy Day” where users have to move their phones around in order to follow the action of the story (full 360 degree rotation in all directions). How would one go about creating such a camera in Unity? Even better would be combining the device’s gyro sensor and accelerometer to allow people to “step” through the space as well. Any code snippets, tutorials, or resources are very much appreciated.

Thanks!

Fortunately, Unity makes this trivial. You can read the gyroscope with Input.gyro, and the accelerometer with Input.acceleration. You can also read the device orientation. Then just apply the values to the transform component of your camera.