Skip to content

格式

typescript
NetConversation.CreateNewEntity(prefab_id, NetEntity?)

所属类: NetConversation

描述

创建新的实体对象。

参数

参数名类型描述
prefab_idstring预制体id
NetEntity?callback回调函数

返回值

类型描述
void

代码示例

typescript
NetServer.on_conversation_connect = async (conv: NetConversation) => {
    conv.CreateNewEntity("prefabID", "userdata", (entity: NetEntity) => {
        Debug.Log("conversation created new entity : ", entity);
    });
}