Pause Google ARCore in Unity

孤人 提交于 2019-12-24 19:29:56

问题


Is there any way to pause, or at least stop ARCore from rotating the screen. I have a menu that I use to "switch" between AR scenes by destroying the gameobject and instantiating it, but when I reactivate the menu the SessionComponent continues to control the camera because it is still tracking the leftover anchor. I have no idea how to delete the anchor because of the fact that it is created by calling Session.CreateAnchor and Session doesn't seem to have a method for removing anchors. I'm assuming that removing the anchor could be the best way to stop ARCore from tracking and would be similar to resetting it, but I can't find out how to remove the Anchor. I tried actually deleting the Anchor, but it seems to be still kept in a list or there seems to be something that still attempt to track it in the Session and Anchor class that causes a nullptr exception.


回答1:


Use ARCoreSession.Destroy(yourAnchor), if this doesn't work use ARCoreSession.DestroyImmediate(yourAnchor).

It is still not updated in the official documentation. But, this is how you achieve it

Cheers!



来源:https://stackoverflow.com/questions/47343239/pause-google-arcore-in-unity

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!