/// <summary> /// 唤醒代码 /// </summary> /// <param name="hasFocus">If set to <c>true</c> has focus.</param> void onApplicationFocus(bool hasFocus) { if (hasFocus) { int BluetoothConnect = AndroidConnection.Instance.Call <int> ("unityBTConnected", 0); if (BluetoothConnect == 0) { AirInput.unConnected(0); } else { AirInput.connected(0); } BluetoothConnect = AndroidConnection.Instance.Call <int> ("unityBTConnected", 1); if (BluetoothConnect == 0) { AirInput.unConnected(1); } else { AirInput.connected(1); } } }
public void onConnectionStateChange(int index, int state) { if (state == 0) { //蓝牙手柄从链接到断开 AirInput.unConnected(index); } else if (state == 1) { //蓝牙手柄从断开到链接 AirInput.connected(index); } }