コード例 #1
0
 private void Update()
 {
     if (trafficLight == null || ai == null)
     {
         return;
     }
     if (trafficLight.status == TrafficLightStatus.Stop)
     {
         ai.HoldBrake();
         return;
     }
     ai.ReleaseBrake();
     RemoveTrafficLight();
 }
コード例 #2
0
 private void FixedUpdate()
 {
     CastRay();
     ai.ReleaseBrake();
     if (shouldStop)
     {
         ai.HoldBrake();
     }
     else
     {
         ai.ReleaseBrake();
     }
     if (trafficLight == null)
     {
         return;
     }
     if (trafficLight.status == TrafficLightStatus.Go)
     {
         ai.ReleaseBrake();
         RemoveTrafficLight();
         return;
     }
     ai.HoldBrake();
 }