Target component name.
Custom event data.
Response event function name.
Target node.
Trigger the target callback with given arguments
The arguments for invoking the callback
Dispatching component events.
The event list to be emitted
The callback arguments
Generated using TypeDoc
The EventHandle class sets the event callback in the scene. This class allows the user to set the callback target node,target component name,component method name, and call the target method through the
emit
method.import { Component } from 'cc'; const eventHandler = new Component.EventHandler(); eventHandler.target = newTarget; eventHandler.component = "MainMenu"; eventHandler.handler = "OnClick"; eventHandler.customEventData = "my data";