// Start is called before the first frame update void Start() { Controller = FindObjectOfType(typeof(RobotController)) as RobotController; Target = null; TargetFoundBy = null; LineFoundBy = new List <LineSensor>(); }
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; } } }
// Start is called before the first frame update void Start() { Controller = FindObjectOfType(typeof(RobotController)) as RobotController; Target = null; TargetFoundBy = null; }