[Unity] Chapter 1 input control, unit chapter 7th Input
Classification: Unity, C #, VS2015
Created on: 1. Introduction
Unity provides an easy-to-use and powerful class for processing Input information: Input, which can be used to process game peripherals such as mouse, keyboard, joystick, steering wheel, and handle, it can also process the touch input information of mobile devices such as iOS and Android.
Programmers can write scripts to receive input information and interact with users.
When writing input processing scripts, you must note that updates to all Unity input information are completed 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:
- Horizontal lines (Horizontal) and Vertical lines (Vertical) map to w, a, s, d, up and down left and right four direction keys.
- Fire1, Fire2, and Fire3 are mapped to the Control, Option (Alt), and Command keys respectively.
- Map Mouse X and Mouse Y to the Mouse movement increment.
- The movement of Window Shake X and Window Shake Y.
Ii. Examples in 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.