Exemple #1
0
 void OnDestroy()
 {
     //         Debug.LogError("OnDestroy 1 ");
     DestroyBluetooth();
     bluetoothSDKUtils = null;
     bluetoothSdk      = null;
 }
Exemple #2
0
        public void Init()
        {
#if UNITY_ANDROID && !UNITY_EDITOR
            //初始化unityactivity(每个android插件初始化的时候都会加上这句保证unityactivity初始化,Init内部保证次方法只执行一次)
            ArShowContext.Instance.Init();
            bluetoothSDKUtils = new AndroidImpl(DEVICENAME, gameObject.name, "ReceiveBluetoothMessage",
                                                SERVICEUUID, CHARUUID, RECEIVERCHARUUID, DESCUUUID);
#elif UNITY_IPHONE && !UNITY_EDITOR
            bluetoothSDKUtils = new iOSImpl(gameObject.name, "ReceiveBluetoothMessage",
                                            DEVICENAME, SERVICEUUID, CHARUUID, RECEIVERCHARUUID, ios_deviceInformationServiceUUID,
                                            ios_hardwareRevisionStringUUID, findOtherDeviceTime);
#endif
        }