mirror of
https://udrimavric.com/MAVRIC/Stratasys-450mc-VR.git
synced 2025-01-26 01:08:28 -05:00
37 lines
863 B
C#
37 lines
863 B
C#
using UnityEngine.Events;
|
|
using UnityEngine.XR.Content.Animation;
|
|
|
|
namespace UnityEngine.XR.Content.Interaction
|
|
{
|
|
public class TargetRing : MonoBehaviour, IAnimationEventActionBegin, IAnimationEventActionFinished
|
|
{
|
|
const string k_ActiveLabel = "active";
|
|
|
|
[SerializeField]
|
|
UnityEvent m_OnHit;
|
|
|
|
[SerializeField]
|
|
UnityEvent m_OnActive;
|
|
|
|
[SerializeField]
|
|
UnityEvent m_OnInactive;
|
|
|
|
public void OnHit()
|
|
{
|
|
m_OnHit.Invoke();
|
|
}
|
|
|
|
void IAnimationEventActionBegin.ActionBegin(string label)
|
|
{
|
|
if (label == k_ActiveLabel)
|
|
m_OnActive.Invoke();
|
|
}
|
|
|
|
void IAnimationEventActionFinished.ActionFinished(string label)
|
|
{
|
|
if (label == k_ActiveLabel)
|
|
m_OnInactive.Invoke();
|
|
}
|
|
}
|
|
}
|