Skip to content

格式

typescript
Contract.FindEntity(entityID)

所属类: Contract

描述

根据entityID查找实体对象。

参数

参数名类型描述
entityIDstringentityID

返回值

类型描述
NetEntity实体对象

代码示例

typescript
class TestRequest extends Contract{
    Exescute(prefab_id: string,user_id: string): void {

        this.CreateNewEntity(prefab_id,user_id,(entity:NetEntity)=>{
            this.Send(TestRequest, entity.entityID);
        });
    }

    Receive(entity_id: string): void {
        let entity = this.FindEntity(entity_id);
        Debug.Log("entity_id :: ",entity_id,"found :: ",entity != null);
    }
}