Пример #1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown("space"))
     {
         serialController.WriteToPort(messageToSend); //calls the WriteToPort function and sends a string to it.
     }
 }
Пример #2
0
    /*
     *  public IEnumerator createCoroutine(int messageIndex, float time) {
     *          yield return new WaitForFixedTime (time);
     *          serialController.WriteToPort(messages[messageIndex]);
     *          Debug.Log ("Sent message " + messages [messageIndex]);
     *  }*/


    public IEnumerator createPausableCoroutine(int messageIndex, float time)
    {
        float timeCount = 0;

        while (timeCount < time)
        {
            if (!pause)
            {
                timeCount += Time.fixedDeltaTime;
            }
            yield return(null);
        }

        yield return(null);

        serialController.WriteToPort(messages[messageIndex]);
        Debug.Log("Sent message " + messages[messageIndex]);
    }
Пример #3
0
 public void SendTestMessage()
 {
     serialController.WriteToPort(testMessage);
 }
Пример #4
0
 // Use this for initialization
 void Start()
 {
     serialController.WriteToPort(messageOnStart);
 }