void CreateImageTarget()
{
IEnumerable<TrackableBehaviour> tbs = TrackerManager.Instance.GetStateManager().GetTrackableBehaviours();
foreach (TrackableBehaviour tb in tbs)
{
Debug.Log(tb.TrackableName);
tb.gameObject.name = "ImageTarget";
//下面这两句不能少,需要给它加上这两个组件
tb.gameObject.AddComponent<DefaultTrackableEventHandler>();
tb.gameObject.AddComponent<TurnOffBehaviour>();
}
}
unity3d:vuforia根据dataset动态创建ImageTarget
最新推荐文章于 2023-07-08 17:14:50 发布