跳到主要内容

set_callback

注册事件处理函数

声明

void set_callback(VisionEvent type, function callback)

参数

参数名描述
type事件类型
callback回调函数

返回值

void

使用方式

object base_ob = new_object(MapVisionBase);
base_ob.set_callback(VisionEvent.EntityEnter, (: on_entity_enter :));
base_ob.set_callback(VisionEvent.EntityLeave, (: on_entity_leave :));
base_ob.set_callback(VisionEvent.EntityMove, (: on_entity_move :));

返回文档