public static Vector2 IntersectionPointStaticCapsuleNonStaticRect(CustomCapsuleCollider2D staticCapsule, CustomBoxCollider2D nonstaticRect, bool collidedVertically = true)
    {
        Vector2 rCenter   = nonstaticRect.GetCenter();
        Vector2 capCenter = staticCapsule.GetCenter();

        if (collidedVertically)
        {
            float xPoint = rCenter.x;
            if (nonstaticRect.bounds.topRight.x < rCenter.x)
            {
                xPoint = nonstaticRect.bounds.topRight.x;
            }
            else if (nonstaticRect.bounds.topLeft.x > rCenter.x)
            {
                xPoint = nonstaticRect.bounds.topLeft.x;
            }

            return(IntersectionPointColliderVerticalAtXPoint(nonstaticRect, staticCapsule, xPoint));
        }
        else
        {
            float yPoint = rCenter.y;
            if (nonstaticRect.bounds.topLeft.y < staticCapsule.bounds.rectBounds.bottomLeft.y)
            {
                yPoint = nonstaticRect.bounds.topLeft.y;
            }
            else if (nonstaticRect.bounds.bottomLeft.y > staticCapsule.bounds.rectBounds.topLeft.y)
            {
                yPoint = nonstaticRect.bounds.bottomLeft.y;
            }

            return(IntersectionPointColliderHorizontalAtYPoint(nonstaticRect, staticCapsule, yPoint));
        }
    }
    /// <summary>
    ///
    /// </summary>
    /// <param name="nonstaticCapsule"></param>
    /// <param name="staticCircle"></param>
    /// <param name="collidedVertically"></param>
    /// <returns></returns>
    public static Vector2 IntersectionPointNonstaticCapsuleStaticCircle(CustomCapsuleCollider2D nonstaticCapsule, CustomCircleCollider2D staticCircle, bool collidedVertically = true)
    {
        Vector2 cCenter   = staticCircle.GetCenter();
        Vector2 capCenter = nonstaticCapsule.GetCenter();
        Vector2 collisionPoint;

        if (collidedVertically)
        {
            if (cCenter.y < capCenter.y)
            {
                collisionPoint = CollisionPointCircleOnCircleBounds(nonstaticCapsule.bounds.bottomCircleBounds, staticCircle.bounds);
            }
            else
            {
                collisionPoint = CollisionPointCircleOnCircleBounds(nonstaticCapsule.bounds.topCircleBounds, staticCircle.bounds);
            }
            return(IntersectionPointColliderVerticalAtXPoint(nonstaticCapsule, staticCircle, collisionPoint.x));
        }
        else
        {
            if (cCenter.y > nonstaticCapsule.bounds.rectBounds.topLeft.y)
            {
                collisionPoint = CollisionPointCircleOnCircleBounds(nonstaticCapsule.bounds.topCircleBounds, staticCircle.bounds);
            }
            else if (cCenter.y < nonstaticCapsule.bounds.rectBounds.bottomLeft.y)
            {
                collisionPoint = CollisionPointCircleOnCircleBounds(nonstaticCapsule.bounds.bottomCircleBounds, staticCircle.bounds);
            }
            else
            {
                collisionPoint = cCenter;
            }
            return(IntersectionPointColliderHorizontalAtYPoint(nonstaticCapsule, staticCircle, collisionPoint.y));
        }
    }