Ejemplo n.º 1
0
    public void PerformRaycast(OnHitAction onHit)
    {
        RaycastHit hit;

        if (Physics.Raycast(transform.position, raycastAxis, out hit, raycastDistance, raycastLayer, QueryTriggerInteraction.Ignore))
        {
            if (onHit != null)
            {
                onHit(hit);
            }
        }
    }
Ejemplo n.º 2
0
    public void PerformRaycast(Vector3 aStartPosition, Vector3 aDirection, float aDistance, LayerMask aLayer, QueryTriggerInteraction aTriggerIgnoreState, OnHitAction onHit)
    {
        RaycastHit hit;

        if (Physics.Raycast(aStartPosition, aDirection, out hit, aDistance, aLayer, aTriggerIgnoreState))
        {
            if (onHit != null)
            {
                onHit(hit);
            }
        }
    }