Vuforia 问题脚本访问私有 TrackableBehaviour

问题描述 投票:0回答:1

我是 C# 的新手,我使用 Vuforia / Unity,

我在 ImageTarget(女巫包含画布)中使用此脚本以了解何时检测到图像(然后修改画布中的元素:文本目标名称/文本描述...) (vuforia 已正确安装)

我收到这个错误:

Assets\Scripts\ListennerSampleScene.cs: error CS0246: The type or namespace name 'TrackableBehaviour' could not be found (are you missing a using directive or an assembly reference?)

在此代码中:

     using System.Collections;
     using System.Collections.Generic;
     using UnityEngine;
     using UnityEngine.UI;
     using Vuforia;

    public class ListennerSampleScene : MonoBehaviour
    {
        private TrackableBehaviour mTrackableBehaviour; 
        // Start is called before the first frame update 

    void Start()
    {
        // je recherche l objet image2Target2Herbizarre dans la scene
        GameObject imageTarget = GameObject.Find("ImageTarget2Herbizarre"); //good, ca marche  
    }

}

我检查了我的项目中是否正确使用了 vuforia 我尝试修改层次结构:arCamera -> imageTarget2Herbizarre-> Model obj + canvas ...

c# unity3d augmented-reality tracking vuforia
1个回答
0
投票

在过去的几年里,我一直在为 Vuforia/Unity 中的所有代码更改而苦苦挣扎,我制作了一个您可能对这个主题感兴趣的视频: https://www.youtube.com/watch?v=5-fEzg3ryss

据我了解,Trackable Behavior 正在贬值,因此我正在使用 Unity 中的 Target Default Observer 事件处理程序,并尽量减少我用来调用触发器的 C# 脚本的数量。我希望这对你有帮助!

© www.soinside.com 2019 - 2024. All rights reserved.