[Unity] Chapter 1 input control, unit chapter 7th Input

Source: Internet
Author: User

[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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.