(19th) unity4.6 learn Ugui Chinese documents ------- interactive-EventSystem, ugui-eventsystem
Hello everyone, I am Sun Guangdong. Reprinted please indicate the source: http://write.blog.csdn.net/postedit/38922399
More comprehensive content please see my game pretty cool address: http://www.unitymanual.com/forum.php? Mod = guide & view = my
5. EventSystem
EventSystem is an object that sends input-based events to an application, whether it is a keyboard, mouse, touch, or custom input. EventSystem is composed of several components that send events.
Overview
When you add the EventSystem component to a game object, you will find that it does not expose many features, because EventSystem itself is designed as a manager and facilitator (Management and host) communication between EventSystem modules.
The main function of EventSystem is as follows:
• Manage which GameObject is consideredselected
• Manage which InputModule is in use
• Manage Raycasting (if required)
• Updating all InputModules as required
• Manage selected game objects
• Manage InputModule in use
• Manages Raycasting (if needed)
• Update all InputModules required
Input Modules
What is the main logic of the input modules represented by EventSystem? They are used:
• Handling Input
• Managing event state
• Sending events to scene objects.
• Process Input
• Manage the event status
• Send events to scene objects.
At the same time, only one InputModule can be active in EventSystem, and they must be components on the same game object as the EventSystem component.
Raycasters
Raycasters is used to send and determine the top of the pointer. It is common for InputModules to use Raycasters. In scenario configuration, it is used to calculate that the pointing device is over.
In three cases, Raycasters exists by default:
• GraphicRaycaster-Used for UI elements
• 2 DPhysicsRaycaster-Used for 2D physicselements
• 3DPhysicsRaycaster-Used for 3D physics elements
• GraphicRaycaster-used for UI elements
• 2DPhysicsRaycaster-used for 2D physical elements
• 3DPhysicsRaycaster-used for 3D physical elements
Zookeeper