RemoveEntity() public method

public RemoveEntity ( int id ) : void
id int
return void
Beispiel #1
0
 static public int RemoveEntity(IntPtr l)
 {
     try {
         GameFramework.EntityManager self = (GameFramework.EntityManager)checkSelf(l);
         System.Int32 a1;
         checkType(l, 2, out a1);
         self.RemoveEntity(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
        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());
                }
            }
        }