private EntityInfo NewEntityInfo(int id) { EntityInfo entity = null; if (m_UnusedEntities.Count > 0) { entity = m_UnusedEntities.Dequeue(); entity.Reset(); entity.InitId(id); } else { entity = new EntityInfo(id); } return(entity); }