UnityEngine Event
2016-12-06 20:05:00 0 举报
UnityEngine Event是Unity引擎中的一个核心概念,用于实现游戏对象之间的交互和通信。通过使用事件系统,开发者可以创建自定义事件,并将其绑定到特定的游戏对象上。当满足特定条件或触发特定操作时,这些事件将被触发并执行相应的事件函数。事件函数可以是任何可调用的方法,通常用于响应游戏中的输入、动画完成或其他逻辑条件。UnityEvent类提供了一种简单的方式来定义和处理这些事件,它允许开发者注册多个方法作为事件的回调函数。通过这种方式,开发者可以实现复杂的游戏逻辑和交互效果,提高游戏的可玩性和用户体验。
作者其他创作
大纲/内容
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 条评论
下一页