mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-07 13:05:41 +00:00
28 lines
517 B
C#
28 lines
517 B
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace QSB.Utility
|
|
{
|
|
internal class RepeatingManager : MonoBehaviour
|
|
{
|
|
public static List<IRepeating> Repeatings = new List<IRepeating>();
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|