Example #1
0
 // This function sets the controllers for a newly created LabBot object
 // Used when a robot is created from file
 public void Initialize()
 {
     wheelController          = gameObject.AddComponent <WheelMotorController>();
     psdController            = gameObject.AddComponent <PSDController>();
     servoController          = gameObject.AddComponent <ServoController>();
     eyeCamController         = gameObject.AddComponent <EyeCameraController>();
     wheelController.wheels   = new List <Wheel>();
     psdController.sensors    = new List <PSDSensor>();
     servoController.servos   = new List <Servo>();
     eyeCamController.cameras = new List <EyeCamera>();
 }
Example #2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(this.gameObject);
     }
 }