[]如何用代码触发点击事件?

比如sprite1注册了点击事件: this.sprite1.on(Laya.Event.CLICK, this, this.sprite1CallBack); 怎样不用点击,而用代码去触发? 是 this.sprite1.event(Laya.Event.CLICK) 这样吗?
已邀请:

chasel

赞同来自:

 
                let event = new Laya.Event()
                button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
 
 

东西

赞同来自:

你不用触发他,你直接执行回调函数不就行了

Aar0n

赞同来自:

直接调用 sprite1CallBack();

要回复问题请先

商务合作
商务合作