UnityEngine Event
2016-11-24 13:30:06 0 举报
UnityEngine Event是Unity引擎中的一个核心功能,用于实现游戏对象之间的交互和通信。通过使用Event系统,开发者可以自定义事件并触发它们,以响应特定的游戏逻辑或用户输入。Event通常与特定类型的GameObject相关联,当满足触发条件时,相关的函数将被调用。这种机制允许开发者创建可扩展的游戏系统,使不同组件之间能够相互协作,实现更丰富的游戏体验。UnityEngine Event提供了灵活的事件订阅和发布模型,使得代码组织更加清晰,易于维护。无论是在单场景还是多场景中,Event都是一种强大的工具,帮助开发者实现复杂的游戏逻辑和交互效果。
作者其他创作
大纲/内容
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 条评论
下一页