"Unity" chapter 7th input Control

Source: Internet
Author: User

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

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.