using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//using XInputDotNetPure;

public class Vibration : MonoBehaviour
{
    private static float vibrationRate = 0.0f;
    public static bool vibrationOn = true;

    void Start()
    {
        vibrationOn = PlayerPrefs.GetInt("Vibration", 1) == 1;
    }

    /*void Update()
    {
        if (vibrationRate > 0.05 && vibrationOn && !PauseMenu.paused) {
            GamePad.SetVibration(0, vibrationRate, vibrationRate / 2.0f);
        }
        else {
            GamePad.SetVibration(0, 0.0f, 0.0f);
        }
        vibrationRate = Mathf.Lerp(vibrationRate, 0.0f, Time.unscaledDeltaTime * 9);
    }

    public static void SetVibration(float v) {
        if (v > 1.0f) {
            v = 1.0f;
        }
        if (v > vibrationRate) {
            vibrationRate = v;
        }
    }
    
    public void OnDisable() {
        vibrationRate = 0.0f;
        GamePad.SetVibration(0, 0.0f, 0.0f);
    }*/
}
