123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- 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;
- }
- }
- }
|