public void StartPairing() { #if UNITY_ANDROID && !UNITY_EDITOR //Add Permission Check if (CheckMiragePermission()) { // Start scanning for peripherals VisionSDK.Instance.Tracking.StartPairing(); // Update text PairButton.GetComponentInChildren <Text>().text = "Looking..."; // Stop scanning in 10 seconds Invoke("StopPairing", 10.0f); } else { MirageAR_AndroidPermissionManager.RequestMirageARPermissions(); } #else // Start scanning for peripherals VisionSDK.Instance.Tracking.StartPairing(); // Update text PairButton.GetComponentInChildren <Text>().text = "Looking..."; // Stop scanning in 10 seconds Invoke("StopPairing", 10.0f); #endif }
IEnumerator Start() { //Wait the SDK Init Complete yield return(new WaitUntil(() => VisionSDK.Instance.Inited)); //Init the Periphera Connected State InitPeripheraState(); //Check Whether is Client:true-Enter the Game,false-Go to Setting Page if (MirageAR_SDK.Instance.MISClient) { StartGame(); } else { #if UNITY_ANDROID && !UNITY_EDITOR //Add Permission Check if (!CheckMiragePermission()) { MirageAR_AndroidPermissionManager.RequestMirageARPermissions(); } #endif //Open Setting(Pairing) UI SettingCanvas.SetActive(true); } VisionSDK.Instance.Connections.OnPeripheralStateChange += OnPeripheralStateChange; }