修改
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Rokid.UXR.Module;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Stary.Evo.RKTools
|
||||
{
|
||||
public class TrackedImageEvoManager : ARTrackedImageManager
|
||||
#if Evo_Rokid
|
||||
public class TrackedImageEvoManager : Rokid.UXR.Module.ARTrackedImageManager
|
||||
{
|
||||
[TableList] public List<TarkedImageEvoData> TrackedImages;
|
||||
#if ODIN_INSPECTOR
|
||||
[Sirenix.OdinInspector.TableList]
|
||||
#endif
|
||||
public List<TarkedImageEvoData> TrackedImages;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
@@ -24,13 +26,14 @@ namespace Stary.Evo.RKTools
|
||||
return imageEvoData;
|
||||
}
|
||||
}
|
||||
|
||||
Debug.LogError($"StaryEvo:未找到对应的图片的id数据,请检查是否进行前置识别 index:{imageIndex}");
|
||||
return null;
|
||||
}
|
||||
|
||||
public void SetTrackedImageEvoData(int imageIndex,string domain, Transform transform)
|
||||
public void SetTrackedImageEvoData(int imageIndex, string domain, Transform transform)
|
||||
{
|
||||
bool isExit=false;
|
||||
bool isExit = false;
|
||||
foreach (var imageEvoData in TrackedImages)
|
||||
{
|
||||
if (imageEvoData.imageIndex == imageIndex)
|
||||
@@ -38,7 +41,7 @@ namespace Stary.Evo.RKTools
|
||||
imageEvoData.position = transform.position;
|
||||
imageEvoData.rotation = transform.eulerAngles;
|
||||
imageEvoData.scale = transform.localScale;
|
||||
isExit=true;
|
||||
isExit = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +67,7 @@ namespace Stary.Evo.RKTools
|
||||
return imageEvoData;
|
||||
}
|
||||
}
|
||||
|
||||
Debug.LogError($"StaryEvo:未找到对应的domain的id数据,请检查是否进行前置识别 domain:{domain}");
|
||||
return null;
|
||||
}
|
||||
@@ -72,11 +76,26 @@ namespace Stary.Evo.RKTools
|
||||
[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;
|
||||
#if ODIN_INSPECTOR
|
||||
[Sirenix.OdinInspector.VerticalGroup("key")]
|
||||
#endif
|
||||
public string domain;
|
||||
#if ODIN_INSPECTOR
|
||||
[Sirenix.OdinInspector.VerticalGroup("key")]
|
||||
#endif
|
||||
public int imageIndex;
|
||||
#if ODIN_INSPECTOR
|
||||
[Sirenix.OdinInspector.VerticalGroup("transform")]
|
||||
#endif
|
||||
public Vector3 position;
|
||||
#if ODIN_INSPECTOR
|
||||
[Sirenix.OdinInspector.VerticalGroup("transform")]
|
||||
#endif
|
||||
public Vector3 rotation;
|
||||
#if ODIN_INSPECTOR
|
||||
[Sirenix.OdinInspector.VerticalGroup("transform")]
|
||||
#endif
|
||||
public Vector3 scale;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user