Files
dungeons/Assets/HurricaneVR/Framework/Scripts/ControllerInput/InputEvents/HVRTriggerButtonEvents.cs

26 lines
727 B
C#

using HurricaneVR.Framework.Shared;
using UnityEngine.Events;
namespace HurricaneVR.Framework.ControllerInput.InputEvents
{
public class HVRTriggerButtonEvents : HVRInputAction
{
public UnityEvent Activated = new UnityEvent();
public UnityEvent Deactivated = new UnityEvent();
public float Value;
protected override void CheckInput(HVRController controller)
{
Value = controller.Trigger;
if (controller.TriggerButtonState.JustActivated)
{
Activated.Invoke();
}
else if (controller.TriggerButtonState.JustDeactivated)
{
Deactivated.Invoke();
}
}
}
}