using ShadowStudio.Tool; using ShadowStudio.UI; using System.Collections; using System.Collections.Generic; using UnityEngine; using XRTool.Util; public class VuforiaFindAction : MonoBehaviour// DefaultTrackableEventHandler { private bool isFind; private bool isOk = true; protected void OnTrackingFound() { isFind = true; } protected void OnTrackingLost() { isFind = false; } private float times; // Update is called once per frame void Update() { if (isFind) { times = times + Time.deltaTime; if (times <= 0.5) { isOk = false; } else { BoardDlg.Instance.transform.position = this.transform.position + new Vector3(0f, 1.5f, 0f) + this.transform.forward.normalized * 2; BoardDlg.Instance.transform.eulerAngles = new Vector3(0, this.transform.eulerAngles.y, 0);//重点 BoardDlg.Instance.OnDragTransfer(); if (!CheckDeviceType.checkIsPhone()) { if (ConsoleDlg.Instance && ConsoleDlg.Instance.vufora_camera) { if (DeviceType.type == "Phone") { } else { ConsoleDlg.Instance.vufora_camera.enabled = false; } } } CommonMethod.ShowScanEffect(false); if (ScanPictureBtn.Instance.Bg) { ScanPictureBtn.Instance.Bg.gameObject.SetActive(false); } isFind = false; isOk = true; //if (StudioRtc.Instance != null && StudioRtc.Instance.me.cIdV != "") //{ // StudioRtc.Instance.startCamera(); //} XRRGBCamera.Instance.playCamera(CustomInfo.mWidth, CustomInfo.mHight); AgoraRTCManager.Instance.JoinChannel(); } } else { RefClilk(); } } public void RefClilk() { times = 0; if (!isOk) { if (!CheckDeviceType.checkIsPhone()) { if (ConsoleDlg.Instance && ConsoleDlg.Instance.vufora_camera) { if (DeviceType.type == "Phone") { } else { ConsoleDlg.Instance.vufora_camera.enabled = false; } } } //if (StudioRtc.Instance != null && StudioRtc.Instance.me != null && StudioRtc.Instance.me.cIdV != "") //{ // StudioRtc.Instance.startCamera(); //} XRRGBCamera.Instance.playCamera(CustomInfo.mWidth, CustomInfo.mHight); CommonMethod.ShowScanEffect(false); if (ScanPictureBtn.Instance.Bg) { ScanPictureBtn.Instance.Bg.gameObject.SetActive(false); } isOk = true; } } }