void Start()
    {
        manualInput = ManualInputs.instance;
        arduino     = manualInput.arduinos[arduinoNum];

        counter = 3;
        StartCoroutine("setBaseline");
    }
Exemple #2
0
 void Start()
 {
     manualInput = ManualInputs.instance;
     arduino     = new Arduino_ManualInputs[arduinoNum];
     for (int i = 0; i < arduinoNum; i++)
     {
         arduino[i] = manualInput.arduinos[i];
     }
 }
Exemple #3
0
    // Use this for initialization
    //new void Awake () {
    //       base.Awake();
    //       boatManager = boat.GetComponent<BoatManager>();
    //       //float posX = transform.position.x * (boat.position.x + Random.Range(0, 5));
    //       //float posY = transform.position.y + Random.Range(3, 7 + 2);       //TODO no magic number!!
    //       //transform.position = new Vector2(posX, posY);
    //       manualInput = ManualInputs.instance;
    //       arduino = manualInput.arduinos[arduinoNum];
    //   }

    new void Start()
    {
        base.Start();
        boatManager = boat.GetComponent <BoatManager>();
        //float posX = transform.position.x * (boat.position.x + Random.Range(0, 5));
        //float posY = transform.position.y + Random.Range(3, 7 + 2);       //TODO no magic number!!
        //transform.position = new Vector2(posX, posY);
        manualInput = ManualInputs.instance;
        arduino     = manualInput.arduinos[arduinoNum];
    }
    void Start()
    {
        manualInput = ManualInputs.instance;
        arduino     = manualInput.arduinos[arduinoNum];

        for (int i = 0; i < counter.Length; i++)
        {
            counter[i] = 3;
        }
        StartCoroutine("setBaseline");
    }
Exemple #5
0
 // Use this for initialization
 void Start()
 {
     button = Button.instance;
     if (buzzInMenu)      //get Arduino and start buzzing
     {
         manualInput = ManualInputs.instance;
         arduino     = manualInput.arduinos[arduinoNum];
         for (int i = 0; i < buzzChars.Length; i++)
         {
             //arduino.sendData(buzzChars[i]);
         }
     }
 }
Exemple #6
0
    // Use this for initialization
    //new void Start () {
    //       base.Start();
    //       boatManager = boat.GetComponent<BoatManager>();
    //       manualInput = ManualInputs.instance;
    //       arduinoOutput = manualInput.arduinos[arduinoOutputNum];
    //   }

    void OnEnable()
    {
        if (boatManager == null)
        {
            base.Start();
            boatManager   = boat.GetComponent <BoatManager>();
            manualInput   = ManualInputs.instance;
            arduinoOutput = manualInput.arduinos[arduinoOutputNum];
        }

        StartCoroutine("startSound");
        toggleLED();
        isLeaking = true;
        Debug.Log("Leak enabled: " + gameObject.name);
    }
Exemple #7
0
    void Awake()
    {
        _arduinos = new Arduino_ManualInputs[arduinoNum];
        if (instance == null)
        {
            instance = this;
            for (int i = 0; i < arduinoNum; i++)
            {
                arduinoPrefab.GetComponent <Arduino_ManualInputs>().portName = portNames[i];
                _arduinos[i] = Instantiate(arduinoPrefab, transform).GetComponent <Arduino_ManualInputs>();
            }
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        DontDestroyOnLoad(gameObject);
    }