namespace UnityHelpers.Utils { using System.Collections.Generic; using UnityEngine; public static class Buffers { public const int BufferSize = 10_000; public static readonly Collider2D[] Colliders = new Collider2D[BufferSize]; public static readonly RaycastHit2D[] RaycastHits = new RaycastHit2D[BufferSize]; /* Note: Only use with CONSTANT time values, otherwise this is a memory leak. DO NOT USE with random values. */ public static readonly Dictionary WaitForSeconds = new(); public static readonly Dictionary WaitForSecondsRealtime = new(); public static readonly System.Random Random = new(); public static readonly WaitForFixedUpdate WaitForFixedUpdate = new(); public static readonly WaitForEndOfFrame WaitForEndOfFrame = new(); } public static class Buffers { public static readonly List List = new(); public static readonly HashSet HashSet = new(); public static readonly Queue Queue = new(); public static readonly Stack Stack = new(); public static readonly LinkedList LinkedList = new(); } }