UnityEngine Event
2016-07-18 13:44:11 0 举报
UnityEngine Event是一种内置在Unity引擎中的特殊类型,用于实现事件驱动编程。它允许开发者创建、触发和管理自定义事件,以便在不同的对象或组件之间进行通信和交互。通过使用Event,可以实现游戏逻辑的解耦和模块化,提高代码的可读性和可维护性。Event通常与委托(Delegate)一起使用,委托是一个指向特定方法的引用,用于表示事件的处理程序。当事件被触发时,所有注册到该事件的方法将被调用。这种机制使得多个对象能够响应同一事件,从而实现更复杂的互动和功能。总之,UnityEngine Event是一种强大的工具,为Unity开发者提供了灵活的事件管理方式。
作者其他创作
大纲/内容
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 条评论
下一页