コード例 #1
0
 public void TickSensors(float time)
 {
     for (int index = 0; index < this.Sensors.Count; ++index)
     {
         INpcSensor sensor    = this.Sensors[index];
         float      deltaTime = time - sensor.LastTickTime;
         if (this.CanTickSensor(deltaTime, sensor))
         {
             this.TickSensor(sensor, deltaTime, time);
             sensor.LastTickTime = time + Random.get_value() * 0.075f;
         }
     }
 }
コード例 #2
0
 public void TickSensors(float time)
 {
     for (int i = 0; i < this.Sensors.Count; i++)
     {
         INpcSensor item   = this.Sensors[i];
         float      single = time - item.LastTickTime;
         if (this.CanTickSensor(single, item))
         {
             this.TickSensor(item, single, time);
             item.LastTickTime = time + UnityEngine.Random.@value * 0.075f;
         }
     }
 }
コード例 #3
0
 protected abstract void TickSensor(INpcSensor sensor, float deltaTime, float time);
コード例 #4
0
 protected virtual bool CanTickSensor(float deltaTime, INpcSensor sensor)
 {
     return((double)deltaTime >= (double)sensor.TickFrequency);
 }