예제 #1
0
        private void StopUpdate(RegularUpdate update)
        {
            if (update == null)
            {
                return;
            }

            update.IsCancelled = true;
            _taskToRemove.Add(update);
        }
예제 #2
0
 public void StartUpdate(ref RegularUpdate task, Action <float> update, float period)
 {
     if (task != null)
     {
         if (task.Update == update)
         {
             return;
         }
         StopUpdate(ref task);
     }
     task             = GetOrCreate();
     task.Update      = update;
     task.Period      = period;
     task.LastUpdate  = Time.time;
     task.IsOnce      = false;
     task.IsCancelled = false;
     _tasks.Add(task);
 }
예제 #3
0
        //public RegularUpdate LateUpdateOnce(Action<float> update)
        //{
        //    var task = StartUpdate(update, Time.fixedDeltaTime + Mathf.Epsilon);
        //    task.IsOnce = true;
        //    return task;
        //}

        public void StopUpdate(ref RegularUpdate update)
        {
            StopUpdate(update);
            update = null;
        }