2025-08-13 18:07:31 +08:00
|
|
|
|
// using System;
|
|
|
|
|
|
// using System.Collections.Generic;
|
|
|
|
|
|
// using Rokid.UXR.Module;
|
|
|
|
|
|
// using Sirenix.OdinInspector;
|
|
|
|
|
|
// using UnityEngine;
|
|
|
|
|
|
//
|
|
|
|
|
|
// namespace Stary.Evo.RKTools
|
|
|
|
|
|
// {
|
|
|
|
|
|
// public class TrackedImageEvoManager : ARTrackedImageManager
|
|
|
|
|
|
// {
|
|
|
|
|
|
// [TableList] public List<TarkedImageEvoData> TrackedImages;
|
|
|
|
|
|
//
|
|
|
|
|
|
// private void Start()
|
|
|
|
|
|
// {
|
|
|
|
|
|
// TrackedImages = new List<TarkedImageEvoData>();
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// public TarkedImageEvoData GetTrackedImageEvoData(int imageIndex)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// foreach (var imageEvoData in TrackedImages)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// if (imageEvoData.imageIndex == imageIndex)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// return imageEvoData;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// Debug.LogError($"StaryEvo:未找到对应的图片的id数据,请检查是否进行前置识别 index:{imageIndex}");
|
|
|
|
|
|
// return null;
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// public void SetTrackedImageEvoData(int imageIndex,string domain, Transform transform)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// foreach (var imageEvoData in TrackedImages)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// if (imageEvoData.imageIndex == imageIndex)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// imageEvoData.position = transform.position;
|
|
|
|
|
|
// imageEvoData.rotation = transform.eulerAngles;
|
|
|
|
|
|
// imageEvoData.scale = transform.localScale;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// public TarkedImageEvoData GetTrackedImageEvoData(string domain)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// foreach (var imageEvoData in TrackedImages)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// if (imageEvoData.domain == domain)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// return imageEvoData;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// Debug.LogError($"StaryEvo:未找到对应的domain的id数据,请检查是否进行前置识别 domain:{domain}");
|
|
|
|
|
|
// return null;
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// public void SetTrackedImageEvoData(string domain, Transform transform)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// foreach (var imageEvoData in TrackedImages)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// if (imageEvoData.domain == domain)
|
|
|
|
|
|
// {
|
|
|
|
|
|
// imageEvoData.position = transform.position;
|
|
|
|
|
|
// imageEvoData.rotation = transform.eulerAngles;
|
|
|
|
|
|
// imageEvoData.scale = transform.localScale;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// [Serializable]
|
|
|
|
|
|
// public class TarkedImageEvoData
|
|
|
|
|
|
// {
|
|
|
|
|
|
// [VerticalGroup("key")] public string domain;
|
|
|
|
|
|
// [VerticalGroup("key")] public int imageIndex;
|
|
|
|
|
|
//
|
|
|
|
|
|
// [VerticalGroup("transform")] public Vector3 position;
|
|
|
|
|
|
// [VerticalGroup("transform")] public Vector3 rotation;
|
|
|
|
|
|
// [VerticalGroup("transform")] public Vector3 scale;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|