void OnTriggerExit(Collider col) { if (IgnoreObjects.Contains(col.gameObject)) { return; } CurrentCollisions.Remove(col.gameObject); OnExit?.Invoke(this, col.gameObject); }
void OnTriggerEnter(Collider col) { if (IgnoreObjects.Contains(col.gameObject)) { return; } CurrentCollisions.Add(col.gameObject); OnEnter?.Invoke(this, col.gameObject); }
public void FilterHits(List <GameObjectRayHit> hits) { hits.RemoveAll(item => !AllowedObjectTypes.Contains(item.HitObject.GetGameObjectType()) || IgnoreObjects.Contains(item.HitObject) || !LayerEx.IsLayerBitSet(_layerMask, item.HitObject.layer)); }
public void FilterOverlaps(List <GameObject> gameObjects) { gameObjects.RemoveAll(item => !AllowedObjectTypes.Contains(item.GetGameObjectType()) || IgnoreObjects.Contains(item) || !LayerEx.IsLayerBitSet(_layerMask, item.layer)); }