Beispiel #1
0
    void OnCollisionEnter(Collision other)
    {
        if (!Math.LayerMaskContainsLayer(layerMask, other.gameObject.layer))
        {
            return;
        }

        SetWobble(other.relativeVelocity);
    }
Beispiel #2
0
    void OnTriggerEnter(Collider other)
    {
        if (!Math.LayerMaskContainsLayer(layerMask, other.gameObject.layer))
        {
            return;
        }

        SetWobble(GetVelocity(other.gameObject));
    }
Beispiel #3
0
        bool PassedLayerMaskCheck(Collider other)
        {
            if (useLayerMask && !Math.LayerMaskContainsLayer(layerMask, other.gameObject.layer))
            {
                Debug.Log(other.name + " is in a layer that doesn't trigger " + name, gameObject);
                return(false);
            }

            return(true);
        }