Exemplo n.º 1
0
    private void OnBluetoothStateChange(BluetoothStates currentState)
    {
        switch (currentState)
        {
        case BluetoothStates.ON:
            SetInfoText("Select your device");
            descriptionText.text = btOnDesctiption;
            PopulateScrollView();
            break;

        case BluetoothStates.TURNING_ON:
            SetInfoText("Turning on Bluetooth...");
            break;

        case BluetoothStates.OFF:
            SetInfoText("Bluetooth is off");
            descriptionText.text = "Turn on Bluetooth to see the list of paired devices.";
            foreach (Transform item in scrollObjParent)
            {
                item.GetComponent <ScrollViewObject>().DeactivateClicks();
            }
            break;

        case BluetoothStates.TURNING_OFF:

            break;
        }
    }
Exemplo n.º 2
0
    public void OnBluetoothStateChange(string state)
    {
        BluetoothStates currentState = BluetoothStates.OFF;

        switch (state)
        {
        case "0":
            currentState = BluetoothStates.OFF;
            break;

        case "1":
            currentState = BluetoothStates.TURNING_OFF;
            break;

        case "2":
            currentState = BluetoothStates.ON;
            break;

        case "3":
            currentState = BluetoothStates.TURNING_ON;
            break;
        }

        BluetoothStateUpdate?.Invoke(currentState);
    }