Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        // set proper pointer visible;



        // if a button is clicked && that hand is not holding anything
        if (ClickUpperButton.GetState(SteamVR_Input_Sources.LeftHand) && !LeftHand.grabPoser)
        {
            counter += Time.deltaTime;
            //Debug.Log("count:" + counter);
        }
        else if (ClickUpperButton.GetState(SteamVR_Input_Sources.RightHand) && !RightHand.grabPoser)
        {
            counter += Time.deltaTime;
            //Debug.Log("count:" + counter);
        }
        if (ClickUpperButton.GetStateUp(SteamVR_Input_Sources.LeftHand) && !LeftHand.grabPoser)
        {
            counter = 0;
        }
        else if (ClickUpperButton.GetStateUp(SteamVR_Input_Sources.RightHand) && !RightHand.grabPoser)
        {
            counter = 0;
        }

        if (counter >= openTime)
        {
            counter   = 0;
            isVisible = true;
            myMenu.ShowSinglePanel(myMenu.FirstPanel.name);
        }
        if (!isVisible)
        {
            transform.position = cam.position;
            Vector3 v = transform.rotation.eulerAngles;
            transform.rotation = Quaternion.Euler(v.x, cam.transform.rotation.eulerAngles.y, v.z);
        }
        else
        {
            myMenu.GetInputModule().pointer.SetLineVisibility(true);
        }
    }
Ejemplo n.º 2
0
 // Update is called once per frame
 void Update()
 {
     myMenu.GetInputModule().pointer.SetLineVisibility(true);
 }