using System.Collections; using System.Collections.Generic; using UnityEngine; using Vuforia; public class VufoiraImgManager : MonoBehaviour { [SerializeField] private VufoiraImageTarget ImagTracker; private bool isRunning = false; void Start () { //初始关闭状态 MessageCenterController.Instance.Register(GameEnum.MESSAGE_SEND_CHANGE_TRACK_IMAGE, ChangeTrack); } protected void OnDestroy() { MessageCenterController.Instance.UnRegister(GameEnum.MESSAGE_SEND_CHANGE_TRACK_IMAGE, ChangeTrack); } //开启识别 private void ChangeTrack(System.Object datas) { isRunning = (bool)datas;//新的状态 CDebug.Log("切换当前的识别状态" + isRunning); ImagTracker.SetTrack(isRunning); } }