Пример #1
0
 public void OnClickButtonConnect(string macID, string serial, bool isConnecting, bool isConnected)
 {
     // attached method for ScanElementClone
             #pragma warning disable CS0162
     if (isLogging)
     {
         Debug.Log(TAG + "OnClickButtonConnect, " + ((isConnecting || isConnected) ? "disconnecting: " : "connecting: ") + macID + " (" + serial + ")");
     }
             #pragma warning restore CS0162
     if (MovesenseController.isInitialized)
     {
         if (isConnecting || isConnected)
         {
             MovesenseController.Disconnect(macID);
         }
         else
         {
             MovesenseController.Connect(macID);
         }
     }
     else
     {
         Debug.LogError(TAG + "OnClickButtonConnect, MovesenseController is NOT initialized. Did you forget to add MovesenseController object in the scene?");
     }
 }
Пример #2
0
    IEnumerator Connect(string macID)
    {
        if (MovesenseController.isInitialized)
        {
            yield return(0);

            MovesenseController.Connect(macID);
        }
        else
        {
            yield return(new WaitForSeconds(0.1F));            // wait for MovesenseController to be initialized

            MovesenseController.Connect(macID);
        }
    }