You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/3rd/D2D_Scripts/Gameplay/DoActionOnStart.cs

26 lines
535 B
C#

3 months ago
using System;
using System.Collections;
using D2D.Utilities;
using UnityEngine;
using UltEvents;
using D2D.Utils;
namespace D2D.Common
{
/// <summary>
/// Invokes the action after the delay
/// </summary>
public class DoActionOnStart : MonoBehaviour
{
[SerializeField] private UltEvent action;
[SerializeField] public Vector2 delay;
private IEnumerator Start()
{
yield return new WaitForSeconds(delay.RandomFloat());
action?.Invoke();
}
}
}