29 lines
624 B
C#
29 lines
624 B
C#
using System;
|
|
using MoreMountains.Feedbacks;
|
|
using Sirenix.OdinInspector;
|
|
using UnityEngine;
|
|
|
|
namespace SLSUtilities.FeelAssistance
|
|
{
|
|
[HideReferenceObjectPicker]
|
|
public class FeedbackUnit
|
|
{
|
|
public MMF_Player feedback;
|
|
[HideInInspector]
|
|
public Action action;
|
|
[HideInInspector]
|
|
public bool canPlay;
|
|
|
|
public void Play() => canPlay = true;
|
|
|
|
public void Update()
|
|
{
|
|
if (canPlay)
|
|
{
|
|
feedback?.PlayFeedbacks();
|
|
action?.Invoke();
|
|
canPlay = false;
|
|
}
|
|
}
|
|
}
|
|
} |