public void Remove(S d) { var category = categorize(d); List <S> cage; if (dataInCategory.TryGetValue(category, out cage) && cage.Remove(d) && cage.Count == 0 && dataInCategory.Remove(category)) { cagePool.Free(cage); } }
private void ClearColliders(bool all = false) { var expirationTime = CurrTime - duration; for (var i = 0; i < colliders.Count;) { var ci = colliders[i]; if (all || ci.birthTime < expirationTime) { colliders.RemoveAt(i); pool.Free(ci); validator.Invalidate(); } else { i++; } } }
static public void DestroyEvent(LogicEvent le) { le.Reset(); msEventPool.Free(le); }