格式
typescript
NetConversation.CreateNewEntity(prefab_id, NetEntity?)所属类: NetConversation
描述
创建新的实体对象。
参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| prefab_id | string | 预制体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);
});
}