public void Add(Cullable cullable) { if (type == Type.HashSet) { hashSet.Add(cullable); } else { list.Add(cullable); } }
public void Remove(Cullable cullable) { if (type == Type.HashSet) { hashSet.Remove(cullable); } else { list.Remove(cullable); } }
//Methods public override bool EnabledAt(Cullable c, Vector3 position) { return((position - this.position).sqrMagnitude < sqrDistance * c.importance); }
private void Cull(Cullable c) { var pos = c.transform.position; c.SetCullEnabled(EnabledAt(c, pos)); }
//Methods public abstract bool EnabledAt(Cullable c, Vector3 position);