public void Tick() { for (int index = 0; index < this.events.Count; ++index) { LocalClock.TimedEvent timedEvent = this.events[index]; if ((double)Time.get_time() > (double)timedEvent.time) { float delta = timedEvent.delta; float variance = timedEvent.variance; timedEvent.action(); timedEvent.time = Time.get_time() + delta + Random.Range(-variance, variance); this.events[index] = timedEvent; } } }
public void Tick() { for (int i = 0; i < this.events.Count; i++) { LocalClock.TimedEvent item = this.events[i]; if (Time.time > item.time) { float single = item.delta; float single1 = item.variance; item.action(); item.time = Time.time + single + UnityEngine.Random.Range(-single1, single1); this.events[i] = item; } } }