예제 #1
0
 void OnMouseDown()
 {
     communications = comPort.GetComponent<UnitySerialPort>() as UnitySerialPort;
     Debug.Log("Mouse Down");
     if (!Occupied)
     {
         Occupied = !Occupied;
         arrow.SetActive(true);
         xSign.SetActive(false);
         if (communications.isActiveAndEnabled)
         {
             communications.setState(0x01, 0x23, Occupied);
         }
     }
     else
     {
         Occupied = !Occupied;
         arrow.SetActive(false);
         xSign.SetActive(true);
         if (communications.isActiveAndEnabled)
         {
             communications.setState(0x1, 0x23, Occupied);
         }
     }
 }
예제 #2
0
 void setRed()
 {
     communications = comPort.GetComponent<UnitySerialPort>() as UnitySerialPort;
     if (communications.isActiveAndEnabled)
     {
         communications.setState((byte)(m_Grana + 1), (byte)(m_Adresa + 1), true);
     }
 }
예제 #3
0
 void setAuto()
 {
     isManualyRed = !isManualyRed;
     communications = comPort.GetComponent<UnitySerialPort>() as UnitySerialPort;
     if (communications.isActiveAndEnabled)
     {
         communications.setState((byte)(m_Grana + 1), (byte)(m_Adresa + 1), false);
     }
 }