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键上的`键后,复制粘贴你的代码块即可。
网友评论