Пример #1
0
    private void OnDrawGizmos()
    {
        Vector2 intersection = new Vector2();

        //Apron.LineIntersection(
        //To2D(transform.position), To2D(transform.forward),
        //To2D(other.position), To2D(other.forward), ref intersection);

        Vector2Utils.RayRayIntersection(To2D(transform.position), To2D(transform.forward),
                                        To2D(other.position), To2D(other.forward), ref intersection);

        Gizmos.DrawLine(transform.position - transform.forward * 1000,
                        transform.position + transform.forward * 1000);
        Gizmos.DrawLine(other.position - other.forward * 1000,
                        other.position + other.forward * 1000);

        Gizmos.DrawWireSphere(new Vector3(intersection.x, 0, intersection.y), 1 * 100);
    }