static void Add(Entity e, T comp, T1 comp1) { MatchedComponents m = GetNew(comp, comp1, e); matched.Add(m); entity_matched_dict.Add(e, m); }
private static MatchedComponents GetNew(T comp, T1 comp1, Entity e) { int count = pool.Count; if (pool.Count == 0) { var m = new MatchedComponents(); m.SetValues(comp, comp1, e); return(m); } else { var m = pool[count - 1]; pool.RemoveAt(count - 1); return(m); } }