コード例 #1
0
    /// <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);
        debugInfo.UpdateSpeedAndRotationScaleMultiplier(moveScaleMultiplier, rotationScaleMultiplier);
    }