When doing a hand tour, 80% of the time is in the PC debugging, such as business logic, AI algorithm, core play and so on.
Get the magic Mirror provided by the demo, dizzy, must be installed on the Android machine, to debug, the reason, there are three:
- Need to use the phone gyroscope
- Need to use Bluetooth handle
- Need to use the mirror's convex lens
These are objective reasons, but after each pack, install Android, and then wear the head, Debug, log what are not see clearly, hehe.
So we start to transform the input shortcut keys, so that you can easily simulate the phone gyro input, analog Bluetooth input, analog non-VR mode switching.
1 Analog Phone Gyroscope input
This has an existing hidden code in the Mojing.cs, in the Updatestate () function.
- Shortcut key F:ok key
- Shortcut key alt: Hold, mouse simulate gazepostion displacement
- Shortcut key CTRL: Hold, mouse simulate gazepostion rotate
2 Analog Bluetooth input
After learning the Mojinginputmanager.onbuttondown\onbuttonup, know that as long as the passing of the past string can be used/separated, the first bit temporarily unused, the second mojingkeycode the number of predefined definitions.
- Shortcut keys WASD: analog bluetooth
- Shortcut key Q: Analog bluetooth OK
3 analog non-VR mode switching
VR mode switching is achieved by setting Mojing.SDK.VRModeEnabled, which is the principle of hiding or displaying the visibility of the left and right camera and center camera. Found in the Demo.cs script, has encapsulated the switch and return the main menu function, call can be:gameobject.findobjectoftype<demo> (). Togglevrmode ();
- Shortcut R: Analog switch VR Mode
- Shortcut B: Simulate back to main menu
Borrow the network a word: VR development, more than the app development, one more camera. Setting up the debugging environment will be much better.
SOURCE Download: MojingInputManagerEditor.cs
To use: Add Mojinginputmanagereditor script to Mojinginputmanager.prefab and click Apply.
Reprint please specify transfer from "Unity3d for VR Learning" (3): Storm mirror PC input small makeover – DIY, clothed
Unity3d for VR Learning (3): Storm mirror PC input small makeover – DIY, clothed