EscapeShooter/My project/Assets/Project Files/Modules/Haptic/Scripts/Runtime/HapticData.cs

26 lines
729 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using UnityEngine;
namespace Watermelon
{
/// <summary>
/// Simple one-shot haptic descriptor used with <see cref="Haptic.Play(HapticData)"/>.
/// </summary>
[System.Serializable]
public class HapticData
{
[SerializeField] float duration = 0.05f;
[SerializeField] float intensity = 0.0f;
/// <summary>Duration of the vibration in seconds.</summary>
public float Duration => duration;
/// <summary>Strength of the vibration (0–1).</summary>
public float Intensity => intensity;
public HapticData(float duration, float intensity = 0.0f)
{
this.duration = duration;
this.intensity = intensity;
}
}
}