Pause Google ARCore in Unity

2019-08-16 04:36发布

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条回答
Luminary・发光体
2楼-- · 2019-08-16 05:17

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!

查看更多
登录 后发表回答