跳到主要内容

listen_other

用任意的函数响应一个指定对象的事件

1.listen_other的调用者必须是静态对象

2.事件响应函数可以不是自己的

3.事件触发者raiser是指定对象的实例

4.事件响应函数被调用时,传入raiser作为参数

static_object.listen_other(other_object_name, "event", event_callback)

raiser.raise("event", 1, 2, 3);

等价于 event_callback.call(raiser, 1, 2, 3)

声明

void listen_other(string ob_name, string event, CommonEventCallback event_callback)

参数

参数名描述
ob_name目标对象名称
event事件id
event_callback事件响应函数(CommonEventCallback实例)

返回值

使用方式

返回文档