Exemple #1
0
        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;
        }
Exemple #2
0
 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);
			}
		}
Exemple #6
0
 private static bool quedForRemoval(Tickable t)
 {
     return(!t.AddedToTickManager);
 }
Exemple #7
0
 public static void RemoveTicker(Tickable tickable)
 {
     tickable.TickRequired       = false;
     tickable.AddedToTickManager = false;
 }