コード例 #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;
        }
コード例 #2
0
 public static void AddTicker(Tickable tickable)
 {
     if (!tickable.AddedToTickManager)
     {
         tickable.AddedToTickManager = true;
         cachedTickerList.Add(tickable);
     }
 }
コード例 #3
0
		private static bool quedForRemoval (Tickable t)
		{
			return !t.AddedToTickManager;

		}
コード例 #4
0
		public static void RemoveTicker (Tickable tickable)
		{
			tickable.TickRequired = false;
			tickable.AddedToTickManager = false;
		}
コード例 #5
0
		public static void AddTicker (Tickable tickable)
		{
			if (!tickable.AddedToTickManager) {
				tickable.AddedToTickManager = true;
				cachedTickerList.Add (tickable);
			}
		}
コード例 #6
0
 private static bool quedForRemoval(Tickable t)
 {
     return(!t.AddedToTickManager);
 }
コード例 #7
0
 public static void RemoveTicker(Tickable tickable)
 {
     tickable.TickRequired       = false;
     tickable.AddedToTickManager = false;
 }