Пример #1
0
 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;
         }
     }
 }
Пример #2
0
 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;
         }
     }
 }
Пример #3
0
 protected abstract void TickReasoner(INpcReasoner reasoner, float deltaTime, float time);
Пример #4
0
 protected virtual bool CanTickReasoner(float deltaTime, INpcReasoner reasoner)
 {
     return((double)deltaTime >= (double)reasoner.TickFrequency);
 }