Skip to content

格式

typescript
NetEntity.setOnBeforeDestroy(c)

所属类: NetEntity

描述

销毁NetEntity时回调。

参数

参数名类型描述
ccallback回调函数

返回值

类型描述
void

代码示例

typescript
NetServer.CreateNewEntity("prefabID", "userdata", (entity: NetEntity) => {
    entity.setOnBeforeDestroy(() => {
        Debug.Log("entity destroyed");
    });
});