quantum-space-buddies/QSB/Utility/RepeatingManager.cs
Mister_Nebula ae8bf9a8b2 aaaaaaaaaa
2021-11-20 19:49:50 +00:00

30 lines
502 B
C#

using System.Collections.Generic;
using UnityEngine;
namespace QSB.Utility
{
internal class RepeatingManager : MonoBehaviour
{
public static List<IRepeating> Repeatings = new();
private const float TimeInterval = 0.4f;
private float _checkTimer = TimeInterval;
private void Update()
{
_checkTimer += Time.unscaledDeltaTime;
if (_checkTimer < TimeInterval)
{
return;
}
foreach (var repeat in Repeatings)
{
repeat.Invoke();
}
_checkTimer = 0;
}
}
}