private static void PerformTickables() { List <Tickable> cachedList = new List <Tickable> (); float timeElapsed = 0; for (int i = 0; i < tickQue.Count; i++) { float startTime = Time.realtimeSinceStartup; Tickable tickable = tickQue [i]; if (timeElapsed > processTime) //Check for time and set as remaining { cachedList.AddRange(tickQue.GetRange(i, tickQue.Count - i)); break; } else { tickable.TickRequired = false; tickable.Tick(); if (!tickable.TickRequired) { RemoveTicker(tickable); } } timeElapsed += (Time.realtimeSinceStartup - startTime) * 1000; } tickQue = cachedList; }
public static void AddTicker(Tickable tickable) { if (!tickable.AddedToTickManager) { tickable.AddedToTickManager = true; cachedTickerList.Add(tickable); } }
private static bool quedForRemoval (Tickable t) { return !t.AddedToTickManager; }
public static void RemoveTicker (Tickable tickable) { tickable.TickRequired = false; tickable.AddedToTickManager = false; }
public static void AddTicker (Tickable tickable) { if (!tickable.AddedToTickManager) { tickable.AddedToTickManager = true; cachedTickerList.Add (tickable); } }
private static bool quedForRemoval(Tickable t) { return(!t.AddedToTickManager); }
public static void RemoveTicker(Tickable tickable) { tickable.TickRequired = false; tickable.AddedToTickManager = false; }