예제 #1
0
    void OnGUI()
    {
        GUI.Label(new Rect(0, 0, Screen.width * 0.15f, Screen.height * 0.1f), "Module Name ");


        if (BtConnector.isConnected())
        {
            if (GUI.Button(new Rect(0, Screen.height * 0.5f, Screen.width, Screen.height * 0.1f), "RequestIMU"))
            {
                UFoneInterface.RequestIMU();
            }
            if (GUI.Button(new Rect(0, Screen.height * 0.6f, Screen.width, Screen.height * 0.1f), "RequestRC"))
            {
                UFoneInterface.RequestRC();
            }

            if (GUI.Button(new Rect(0, Screen.height * 0.7f, Screen.width, Screen.height * 0.1f), "ARM"))
            {
                UFoneInterface.SetRawRC(1400, 1410, 1420, 1000, 1950, 1500, 1500, 1501);
            }

            if (GUI.Button(new Rect(0, Screen.height * 0.8f, Screen.width, Screen.height * 0.1f), "DisArm"))
            {
                UFoneInterface.SetRawRC(1400, 1410, 1420, 1000, 1050, 1500, 1500, 1500);
            }
        }
        else
        {
            if (GUI.Button(new Rect(0, Screen.height * 0.4f, Screen.width, Screen.height * 0.1f), "Try Connect"))
            {
                if (!BtConnector.isBluetoothEnabled())
                {
                    BtConnector.askEnableBluetooth();
                }
                else
                {
                    BtConnector.connect();
                }
            }

            if (GUI.Button(new Rect(0, Screen.height * 0.9f, Screen.width, Screen.height * 0.1f), "Show"))
            {
                BtConnector.showDevices();
            }
        }
    }
예제 #2
0
 public void SelectDevices()
 {
     BtConnector.showDevices();
 }