You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
359 B
19 lines
359 B
using UnityEngine;
|
|
using UnityEngine.Events;
|
|
|
|
public class DelayEvent : MonoBehaviour
|
|
{
|
|
[SerializeField] private float _delayInSeconds;
|
|
[SerializeField] private UnityEvent _event;
|
|
|
|
public void InvokeDelayed()
|
|
{
|
|
Invoke(nameof(InvokeEvent), _delayInSeconds);
|
|
}
|
|
|
|
private void InvokeEvent()
|
|
{
|
|
_event?.Invoke();
|
|
}
|
|
|
|
} |