UnityEngine Event
2016-10-18 16:42:51 0 举报
UnityEngine Event是Unity引擎中的一个核心系统,用于实现游戏对象之间的交互和通信。它允许开发者创建自定义事件,通过触发这些事件来执行特定的操作或响应特定的情况。Event通常与方法一起使用,当事件发生时,与之关联的方法将被调用。这种机制使得游戏逻辑更加模块化和可扩展,使开发者能够轻松地添加新功能或修改现有功能而不影响整个系统的运行。UnityEngine Event还提供了许多内置的事件类型,如鼠标点击、键盘输入、碰撞等,以及用于控制游戏循环和动画的特定事件。通过合理地使用UnityEngine Event,开发者可以构建出复杂而有趣的游戏系统。
作者其他创作
大纲/内容
StandaloneInputModule
+ ctor()+ AddListener(UnityAction)+ RemoveListener(UnityAction);+ Invoke()
AxisEventData
+ moveDir+ moveVector
PointerInputModule
BaseInputModule
+ Process() : 每帧调用
IDe/SelectHandler
IPointerXXXHandler
IDragXXXHandler
PhysicsRayCaster
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
PointerEventData
+ button+ delta+ scrollDelta+ pointerCurrentRaycast+ position+ worldPosition
需要绑定在同一个GameObject上
0 条评论
下一页