Пример #1
0
    void OnTriggerExit(Collider col)
    {
        if (IgnoreObjects.Contains(col.gameObject))
        {
            return;
        }

        CurrentCollisions.Remove(col.gameObject);
        OnExit?.Invoke(this, col.gameObject);
    }
Пример #2
0
    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));
 }