Exemplo n.º 1
0
        private RaycastHit2D CheckInteractableInFront(DirectionFacing direction)
        {
            const float checkLength = 2f;

            Vector2 castDirection = MovementState.GetSurfaceDirection(direction == DirectionFacing.Left ? DirectionTravelling.Left : DirectionTravelling.Right);

            return(Physics2D.BoxCast(Collider.bounds.center, new Vector2(0.1f, Collider.bounds.size.y), 0, castDirection, checkLength, 1 << LayerMask.NameToLayer(Layers.Interactable)));
        }