Example #1
0
    // UpdateSpeedAndRotationMultiplier
    void UpdateSpeedAndRotationScaleMultiplier()
    {
        float moveScaleMultiplier = 0.0f;

        PlayerController.GetMoveScaleMultiplier(ref moveScaleMultiplier);
        if (Input.GetKeyDown(KeyCode.Alpha7))
        {
            moveScaleMultiplier -= SpeedRotationIncrement;
        }
        else if (Input.GetKeyDown(KeyCode.Alpha8))
        {
            moveScaleMultiplier += SpeedRotationIncrement;
        }
        PlayerController.SetMoveScaleMultiplier(moveScaleMultiplier);

        float rotationScaleMultiplier = 0.0f;

        PlayerController.GetRotationScaleMultiplier(ref rotationScaleMultiplier);
        if (Input.GetKeyDown(KeyCode.Alpha9))
        {
            rotationScaleMultiplier -= SpeedRotationIncrement;
        }
        else if (Input.GetKeyDown(KeyCode.Alpha0))
        {
            rotationScaleMultiplier += SpeedRotationIncrement;
        }
        PlayerController.SetRotationScaleMultiplier(rotationScaleMultiplier);

        if (ShowVRVars == true)       // limit gc
        {
            strSpeedRotationMultipler = System.String.Format("Spd.X: {0:F2} Rot.X: {1:F2}",
                                                             moveScaleMultiplier,
                                                             rotationScaleMultiplier);
        }
    }
    /// <summary>
    /// Updates the speed and rotation scale multiplier.
    /// </summary>
    void UpdateSpeedAndRotationScaleMultiplier()
    {
        float moveScaleMultiplier = 0.0f;

        playerController.GetMoveScaleMultiplier(ref moveScaleMultiplier);

        if (Input.GetKeyDown(KeyCode.Alpha7))
        {
            moveScaleMultiplier -= speedRotationIncrement;
        }
        else if (Input.GetKeyDown(KeyCode.Alpha8))
        {
            moveScaleMultiplier += speedRotationIncrement;
        }

        playerController.SetMoveScaleMultiplier(moveScaleMultiplier);

        float rotationScaleMultiplier = 0.0f;

        playerController.GetRotationScaleMultiplier(ref rotationScaleMultiplier);

        if (Input.GetKeyDown(KeyCode.Alpha9))
        {
            rotationScaleMultiplier -= speedRotationIncrement;
        }
        else if (Input.GetKeyDown(KeyCode.Alpha0))
        {
            rotationScaleMultiplier += speedRotationIncrement;
        }

        playerController.SetRotationScaleMultiplier(rotationScaleMultiplier);
    }