3.7 到底怎么发送自定义事件的呢

import { _decorator, Component, EventInfo, Node } from ‘cc’;

const { ccclass, property } = _decorator;

@ccclass(‘BlockEvent’)

export class BlockEvent extends Event {

constructor(name: string, bubbles?:boolean, detail?: any){

    var e: EventInit;

    e.bubbles = bubbles;

    super( name , e);

    this.detail = detail

}

public detail: any = null;

}

这个是我的自定义类

这又是什么情况呢

求大佬 帮帮忙


你的Event没有导入,你的Event非cc的Event

这个要手动导入的吗,我看没有没有波浪线还以为自己动导入了

3.x 的一个烦人点,Node、Animation、Event都要手动选择导入,不然默认导入的是lib里面的