29 lines
716 B
C#
29 lines
716 B
C#
|
using BNG;
|
||
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
[System.Serializable]
|
||
|
public class VibrationSettings
|
||
|
{
|
||
|
public float Frequency;
|
||
|
public float Amplitude;
|
||
|
public float Duration;
|
||
|
}
|
||
|
|
||
|
public class HapticsEffect : MonoBehaviour
|
||
|
{
|
||
|
private InputBridge inputBridge;
|
||
|
|
||
|
private void Awake()
|
||
|
{
|
||
|
inputBridge = GetComponent<InputBridge>();
|
||
|
}
|
||
|
|
||
|
public void Vibrate(VibrationSettings vibration)
|
||
|
{
|
||
|
inputBridge.VibrateController(vibration.Frequency, vibration.Amplitude, vibration.Duration, ControllerHand.Left);
|
||
|
inputBridge.VibrateController(vibration.Frequency, vibration.Amplitude, vibration.Duration, ControllerHand.Right);
|
||
|
}
|
||
|
}
|