Example #1
0
 // Start is called before the first frame update
 void Start()
 {
     Controller    = FindObjectOfType(typeof(RobotController)) as RobotController;
     Target        = null;
     TargetFoundBy = null;
     LineFoundBy   = new List <LineSensor>();
 }
Example #2
0
    void Scan()
    {
        // Assume we lost them
        Target        = null;
        TargetFoundBy = null;

        // Find out what it sees
        foreach (OpticalSensor sensor in Controller.OpticalSensors)
        {
            if (sensor.Hit())
            {
                Target        = sensor.HitObject();
                TargetFoundBy = sensor;
                break;
            }
        }
    }
Example #3
0
 // Start is called before the first frame update
 void Start()
 {
     Controller    = FindObjectOfType(typeof(RobotController)) as RobotController;
     Target        = null;
     TargetFoundBy = null;
 }