예제 #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);
 }