Example #1
0
File: UI.cs Project: moderndev/CTP2
    void Update()
    { //Draw Roads
        Ray     mouseRay = cam.ScreenPointToRay(Input.mousePosition);
        Vector3 mousePos = Vector3.zero;

        if (mouseRay.direction.y != 0)
        {
            float dstToXZPlane = Mathf.Abs(mouseRay.origin.y / mouseRay.direction.y);
            mousePos = mouseRay.GetPoint(dstToXZPlane);
        }
        //When you Click saves to a list
        if (Input.GetMouseButtonDown(1))
        {
            generator.AddPoint(mousePos);
        }
    }