Example #1
0
    void Update()
    {
        if (Input.GetKeyUp(KeyCode.Space))
        {
            m_ObjectShooter.RequestFire(Input.mousePosition);
        }

        if (Input.GetMouseButton(0) && Input.mousePosition.y > guiHeight)
        {
            var camera = GetCamera();

            Ray ray = camera.ScreenPointToRay(Input.mousePosition);

            var planeLayer = GetComponent <ARPlaneVisualizer>().planeLayer;
            int layerMask  = 1 << planeLayer;

            RaycastHit rayHit;
            if (Physics.Raycast(ray, out rayHit, float.MaxValue, layerMask))
            {
                m_ARController.pointOfInterest = m_LevelGeometry.transform.position;
                m_ARController.AlignWithPointOfInterest(rayHit.point);
                m_ObjectShooter.minimumYValue = rayHit.point.y;
            }
        }
    }