示例#1
0
        public void RemoveCop <T>() where T : ICop
        {
            Type type = typeof(T);

            if (m_Cops.TryGetValue(type, out ICop cop))
            {
                m_Cops.Remove(type);
                cop.OnRemove();
            }
        }
示例#2
0
        private void TickRemoveEntities()
        {
            int length = m_Removes.Count;

            if (length > 0)
            {
                for (int i = 0; i < length; ++i)
                {
                    uint   eid    = m_Removes[i];
                    Entity entity = GetEntity(eid);
                    if (entity != null)
                    {
                        if (m_Entities.Remove(eid))
                        {
                            entity.OnRemove();
                        }
                    }
                }
                m_Removes.Clear();
            }
        }