Categories: Unity, C #, VS2015
Date Created: 2016-04-21 I. INTRODUCTION
Unity provides a very easy-to-use and powerful class for handling input information: input, which can handle game peripherals such as mouse, keyboard, joystick/steering wheel/joystick, or touch input information for mobile devices such as Ios/androd.
The programmer receives input information by writing a script and completes the interaction with the user.
When writing scripts that process input, be aware that updates to all of unity's input information are done in the Update method. In other words, scripts related to input processing should be placed in the Update method.
In the script, all virtual axes are accessed by name.
At the time of creation, all projects have the following default input axes:
- The horizontal line (horizontal) and vertical lines (Vertical) map to W, a, S, D, and up and down 4 arrow keys.
- Fire1, Fire2, and Fire3 are mapped to Control, Option (ALT), and Command keys, respectively.
- Mouse X and Mouse Y are mapped to mouse movement increments.
- Window Shake X and Windows Shake Y correspond to the movement of the screen.
Ii. examples of this chapter
All source code in this chapter can be found in unitybook/chapte14/project/rotateexample.
All source code in this chapter is in the Ch07demos project.
"Unity" chapter 7th input Control