示例#1
0
    // Use this for initialization
    void Start()
    {
        currentRotationAmount = 0.0f;

        try
        {
            experimentManager = GameObject.Find(experimentManagerName).GetComponent <ExperimentManager>();
            experimentManager.RotatePerson(currentRotationAmount);
        }
        catch
        {
            Debug.LogError("Unable to link to experiment manager...");
            Application.Quit();
        }
    }
示例#2
0
    private void RotatePersonHelper(SteamVR_Controller.Device device)
    {
        Vector2 touchpad = device.GetAxis(Valve.VR.EVRButtonId.k_EButton_SteamVR_Touchpad);

        currentRotationAmount += (touchpad.x > 0) ? rotationAmount : (-1 * rotationAmount);

        if (currentRotationAmount > 360.0f)
        {
            currentRotationAmount -= 360.0f;
        }
        if (currentRotationAmount < 0.0f)
        {
            currentRotationAmount += 360.0f;
        }

        experimentManager.RotatePerson(currentRotationAmount);
    }