mirror of
https://github.com/ConjureETS/Unity_Utils.git
synced 2026-03-24 04:50:58 +00:00
19 lines
533 B
C#
19 lines
533 B
C#
using System.Collections.Generic;
|
|
using JetBrains.Annotations;
|
|
using UnityEngine;
|
|
|
|
namespace JohnsonUtils.Utilities
|
|
{
|
|
public static class Helpers
|
|
{
|
|
private static readonly Dictionary<float, WaitForSeconds> WaitDictionary = new();
|
|
|
|
[PublicAPI]
|
|
public static WaitForSeconds GetWait(float time)
|
|
{
|
|
if (WaitDictionary.TryGetValue(time, out var wait)) return wait;
|
|
WaitDictionary[time] = new WaitForSeconds(time);
|
|
return WaitDictionary[time];
|
|
}
|
|
}
|
|
} |