Ejemplo n.º 1
0
        //find and connect to a Play Tray
        public void Connect()
        {
            PortName    = "";
            partialLine = "";
            string[] playTrays = PuzzletUtility.GetPlayTrayPorts();
            Debug.Log("all play trays");
            foreach (string playTray in playTrays)
            {
                Debug.Log(playTray);
            }
            foreach (string playTray in playTrays)
            {
                if (!badConnections.Contains(playTray))
                {
                    PortName = playTray;
                    break;
                }
            }
            if (PortName == "")
            {
                badConnections.Clear();
                StartCoroutine(RetryConnection());
                return;
            }
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
            serialPort = new WindowsSerial();
#elif UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX
            serialPort = new MacSerial();
#endif
            serialPort.OpenSerial(PortName, Baud);
            puzzletConnection.PuzzletConnected();
        }
Ejemplo n.º 2
0
 public void PuzzletConnectedIOS()
 {
     puzzletConnection.PuzzletConnected();
 }
Ejemplo n.º 3
0
 public void PuzzletConnectedAndroid()
 {
     puzzletConnection.PuzzletConnected();
 }