UnityEngine Event & EventSystem系统架构图
2017-02-14 00:26:28 0 举报
UnityEngine的Event & EventSystem系统架构图展示了一个复杂的事件处理和分发机制。该系统由多个组件组成,包括事件触发器、事件监听器、事件管理器等。事件触发器负责生成事件,并将其传递给事件管理器。事件管理器根据事件的类型和目标对象,将事件分发给相应的事件监听器。事件监听器可以是自定义的脚本组件,用于响应特定类型的事件。此外,系统还提供了一些内置的事件类型,如鼠标点击、键盘输入等,以及一些常用的事件功能,如事件冒泡、事件捕获等。通过这个系统,开发者可以轻松地实现游戏中的交互逻辑和状态管理。
作者其他创作
大纲/内容
StandaloneInputModule
+ ctor()+ AddListener(UnityAction)+ RemoveListener(UnityAction);+ Invoke()
PointerInputModule
AxisEventData
+ moveDir+ moveVector
BaseInputModule
+ Process() : 每帧调用
IDe/SelectHandler
IPointerXXXHandler
PhysicsRayCaster
IDragXXXHandler
BaseRayCaster
IEventSystemHandler
BaseEventData
+ currentInputModule.+ selectedObject+ used
TouchInputModule
EventSystem
+ currentInputModule + static current : EventSystem+ (current/first/last)SelectedGameObject: GameObject
+ RaycastAll(PointerEventData List);
UnityEvent分为泛型和非泛型两种,用法各有不同,不同模版参数的UnityEvent对应相应的UnityAction
UnityEventBase
+ GetPersistentEventCount() : int+ GetPersistentMethodName(int) : string+ GetPersistentTarget(int) : Object+ RemoveAllListeners()
Physics2DRayCaster
需要绑定在同一个GameObject上
PointerEventData
+ button+ delta+ scrollDelta+ pointerCurrentRaycast+ position+ worldPosition
0 条评论
下一页