美文网首页
Hololens将目标显示到眼前_2022-09-28

Hololens将目标显示到眼前_2022-09-28

作者: 午字横 | 来源:发表于2022-09-27 18:42 被阅读0次
private void PlaceModel()
    {
#if UNITY_WSA
        if (modelArAnchor != null)
        {
            DestroyImmediate(modelArAnchor);
        
            modelArAnchor = null;
        }
#endif

        if (modelEntityGO != null)
        {
            modelEntityGO.transform.position = Camera.main.transform.position + Camera.main.transform.forward * 2;
#if UNITY_WSA
            // anchor the model in the world
            modelArAnchor = modelEntityGO.AddComponent<ARAnchor>();
#endif    
        }
    }

在你新建的文章中,当需要插入代码片段的时候,在英文状态下输入键盘tab键上的`键后,复制粘贴你的代码块即可。

相关文章

网友评论

      本文标题:Hololens将目标显示到眼前_2022-09-28

      本文链接:https://www.haomeiwen.com/subject/gmwcartx.html