如果我们希望从EventSystem接受事件,则需要在GameObject上添加EventTrigger组件。

NOTE: Attaching this component to a GameObject will make that object intercept ALL events, and no event bubbling will occur from this object!


EventSystem

在场景( Unity scene)处理输入(input)、射线和发送事件。一个场景中仅仅包含一个EventSystem,当我们在场景中创建一个UI组件时,Unity会自动给我创建一个EventSystem组件。