AnimationLibraryDefination Memory泄漏真人股Kit Arkit
因此,我有一个使用RealityKit的Arview。我正在重复使用Arview。我有一个动画的实体(存储在.usdz文件中)。我使用以下代码播放动画。
hummingbird = try! Entity.load(named: "bird")
for animation in hummingbird.availableAnimations {
hummingbird.playAnimation(animation.repeat(duration: 120.0))
}
但是,我注意到有内存泄漏。使用我发现它是在Playanimation系列中的仪器。 我不知道如何解决此问题。在Arview的结尾,我这样做:
hummingbird.stopAllAnimations(recursive: true)
hummingbird = nil
我认为应该足够。但不是。 在图像中,有两个实例。从运行相同的Arview 2次。
基本上,我的设置是 startvc-> arview-> backtostartvc-> backtosamearview(带有新的配置)。等等。 任何想法都会很棒。如果您有任何疑问或需要澄清。请问。
So I have a ARView using realitykit. I am reusing the ARView. I have a Entity that has animations (stored in .usdz file). I play the animation with the following line of code.
hummingbird = try! Entity.load(named: "bird")
for animation in hummingbird.availableAnimations {
hummingbird.playAnimation(animation.repeat(duration: 120.0))
}
However, I noticed there is a memory leak. using Instruments I found it was at the playAnimation line.
I have no clue how to fix this. At the end of the ARView I do this:
hummingbird.stopAllAnimations(recursive: true)
hummingbird = nil
I thought that should be enough. But it isn't.
In the image, there are 2 instances. That from running the same arview 2 times.
Basically, my setup is
startVC->ARView->backToStartVC->backToSameARView (with new configuration). And so on.
Any idea would be great. And if you have any questions or need clarification. Please ask.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论