GetEntityInfoByUnitId() public method

public GetEntityInfoByUnitId ( int id ) : EntityInfo
id int
return EntityInfo
        public void DestroyEntities(int[] unit_ids)
        {
            Msg_RC_DestroyNpc destroyNpcBuilder = new Msg_RC_DestroyNpc();

            for (int i = 0; i < unit_ids.Length; i++)
            {
                EntityInfo npc = EntityManager.GetEntityInfoByUnitId(unit_ids[i]);
                if (npc != null)
                {
                    destroyNpcBuilder.npc_id = npc.GetId();
                    NotifyAllUser(RoomMessageDefine.Msg_RC_DestroyNpc, destroyNpcBuilder);
                    EntityManager.RemoveEntity(npc.GetId());
                }
            }
        }
示例#2
0
 static public int GetEntityInfoByUnitId(IntPtr l)
 {
     try {
         GameFramework.EntityManager self = (GameFramework.EntityManager)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         var ret = self.GetEntityInfoByUnitId(a1);
         pushValue(l, true);
         pushValue(l, ret);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }