UnityEngine Event
2016-09-02 13:50:26 0 举报
UnityEngine Event是Unity游戏引擎中的一种功能,它允许开发者在特定的事件发生时触发一系列的操作。这些事件可以是玩家的输入(如点击、移动等)、游戏对象的交互(如碰撞、触发器等)或者是游戏的进程(如关卡开始、结束等)。通过使用Event,开发者可以更好地控制游戏的逻辑和流程,实现更复杂的交互效果。例如,当玩家按下某个键时,可以触发一个事件,然后执行一段特定的代码;或者当两个游戏对象发生碰撞时,可以触发一个事件,然后改变它们的属性或状态。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 条评论
下一页