public void TickReasoners(float time) { for (int index = 0; index < this.Reasoners.Count; ++index) { INpcReasoner reasoner = this.Reasoners[index]; float deltaTime = time - reasoner.LastTickTime; if (this.CanTickReasoner(deltaTime, reasoner)) { this.TickReasoner(reasoner, deltaTime, time); reasoner.LastTickTime = time + Random.get_value() * 0.075f; } } }
public void TickReasoners(float time) { for (int i = 0; i < this.Reasoners.Count; i++) { INpcReasoner item = this.Reasoners[i]; float single = time - item.LastTickTime; if (this.CanTickReasoner(single, item)) { this.TickReasoner(item, single, time); item.LastTickTime = time + UnityEngine.Random.@value * 0.075f; } } }
protected abstract void TickReasoner(INpcReasoner reasoner, float deltaTime, float time);
protected virtual bool CanTickReasoner(float deltaTime, INpcReasoner reasoner) { return((double)deltaTime >= (double)reasoner.TickFrequency); }