For Android platforms, the physical Bluetooth handle has been encapsulated, the upper application is not visible, that is, for the upper application, do not distinguish between Bluetooth handles or other handles;
After completing the Bluetooth handle and the Bluetooth connection of the Android phone, you can get its key value in Unity3d;
In U3d, there are two main types of fetching interfaces for handle key values:
1. Joystick:
Translationy = Input.getaxis ("Vertical") * 10.0f;
Translationx = Input.getaxis ("horizontal") * 10.0f;
The precision returned by the Input.getaxis is [ -1,1], which varies from 1 to 1 with the joystick pulling;
2. Key:
Input.anykeydown
Input.getkeydown (KeyCode)
Input.getkeyup (KeyCode)
Input.getkey (KeyCode)
Record the key embodied distribution of the handle on the hand:
Leftshit Rightshit
Leftalt RightAlt
Axis (JoystickButton8 when pressed) JoystickButton3
JoystickButton2 JoystickButton1
JoystickButton0
(JoystickButton9 when pressed)
Based on the Android platform, u3d the Bluetooth handle key value acquisition