AR锚在Unity Hub中

发布于 2025-02-01 02:29:01 字数 525 浏览 3 评论 0原文

我正在尝试构建一个简单的AR模型,该模型将飞机覆盖在图像目标上。但是几天来,我得到了此警告

1. packages \ package \ vuforia \ scripts \ internal \ arfoundationIntegration \ arfoundationfacade.cs(268,26):警告CS0618:'Aranchormanager.addanchor(pose)'is of Anchore'is of Anchorte:'是锚定:使用AddComponent()。 (2020-10-06)'

2. packages \ package \ vuforia \ scripts \ internal \ arfoundation-integration \ arfoundationfacade.cs(298,17):警告cs0618:'aranchormanager.removeanchor(aranchor)'在aranchor组件上删除它。 (2020-10-06)'

我第一次面临这个问题,也是这个领域的新手。有人可以指导解决这个问题。提前致谢!

I am trying to build a simple ar model which just overlays a plane over an image target. But for a few days I get this warnings

1.Packages\package\Vuforia\Scripts\Internal\ARFoundationIntegration\ARFoundationFacade.cs(268,26): warning CS0618: 'ARAnchorManager.AddAnchor(Pose)' is obsolete: 'Add an anchor using AddComponent(). (2020-10-06)'

2.Packages\package\Vuforia\Scripts\Internal\ARFoundationIntegration\ARFoundationFacade.cs(298,17): warning CS0618: 'ARAnchorManager.RemoveAnchor(ARAnchor)' is obsolete: 'Call Destroy() on the ARAnchor component to remove it. (2020-10-06)'

I am facing this problem for the first time and also I am new to this field. Can someone guide to solve this issue. Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

自控 2025-02-08 02:29:01

Doucmnentaion仍然有点令人困惑,因为它仍然显示了已过时的方法,尽管它在详细信息中表明它们已被淘汰,但没有与更新文档的链接(目前)。

查看一些可用的示例可能是最容易的 - 例如,此集合包括使用AddComponent创建新锚的示例: https://github.com/unity-technologies/arfoundation-samplease/blob/main/main/scripts/scripts/scripts/anchorcreator.cs

            // Note: the anchor can be anywhere in the scene hierarchy
            var gameObject = Instantiate(prefab, hit.pose.position, hit.pose.rotation);

            // Make sure the new GameObject has an ARAnchor component
            anchor = gameObject.GetComponent<ARAnchor>();
            if (anchor == null)
            {
                anchor = gameObject.AddComponent<ARAnchor>();
            }

更多详细信息在此处: https://developers.google.com/ar/ar/develovelvely.com/ar/develovelvelveling/ Unity-arf/功能

The doucmnentaion is a little confusing as it still shows the obsoleted methods, although in the detail it shows they are obsoleted but with no links to newer documentation (at this time).

It may be easiest to look at some of the examples available - for example this set includes examples using AddComponent to create a new Anchor: https://github.com/Unity-Technologies/arfoundation-samples/blob/main/Assets/Scripts/AnchorCreator.cs

            // Note: the anchor can be anywhere in the scene hierarchy
            var gameObject = Instantiate(prefab, hit.pose.position, hit.pose.rotation);

            // Make sure the new GameObject has an ARAnchor component
            anchor = gameObject.GetComponent<ARAnchor>();
            if (anchor == null)
            {
                anchor = gameObject.AddComponent<ARAnchor>();
            }

More detail on ARFoundtaion here: https://developers.google.com/ar/develop/unity-arf/features

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文