Beispiel #1
0
    void Update()
    {
        lineRenderer.SetWidth(lineWidth, lineWidth);
        lineRenderer.SetPosition(0, vrController.transform.position);
        lineRenderer.SetPosition(1, vrController.transform.position + (vrController.transform.forward * pointerDistance));
        lineRenderer.enabled = true;

        pointerCircle.transform.position = vrController.transform.position + (vrController.transform.forward * pointerDistance);
        selectableDataPoints             = getSelectableObjects(pointerCircle);
        pointerText.text = selectableDataPoints.Count.ToString();
        pointerText.transform.LookAt(vrHead.transform);
        pointerText.transform.Rotate(new Vector3(0.0f, 180.0f, 0.0f));

        if (SteamVR_Controller.Input(SteamVR_Controller.GetDeviceIndex(SteamVR_Controller.DeviceRelation.Leftmost)).GetHairTriggerDown())
        {
            if (selectableDataPoints.Count > 0)
            {
                selectedDataPointIndex++;
                if (selectedDataPointIndex >= selectableDataPoints.Count)
                {
                    selectedDataPointIndex = 0;
                }
                screenDisplayData.SetDataPoint(selectableDataPoints[selectedDataPointIndex].GetComponent <DataPoint>());
            }
        }
    }