public Collider(BoundingBox bounding, Component comp, GameObject owner) { if (collidersList == null) { collidersList = new List <Collider>(); } component = comp; boundingBox = bounding; collidersList.Add(this); this.owner = owner; }
//TODO Styczeń to nie działa, robimy to inaczej, żal skasować, napraw xd public override void Dispose() { owner?.colliders.Remove(this); owner = null; foreach (Collider collider in collidersList) { collider?.Dispose(); collidersList.Remove(collider); } base.Dispose(); }