本文介绍了DontDestroyOnLoad-如何销毁?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我正在开发 Vuforia (旧版)应用程序.

I'm working on a Vuforia (legacy) application.

在Unity的播放"模式下,我可以看到正在生成某些"DontDestroyOnLoad"内容(看起来像是照相机).

In "Play" mode in Unity I can see that some "DontDestroyOnLoad" content is being generated, (looks like it's sort of a camera).

这可能是为什么我在场景之间切换时遇到一些问题的原因,所以问题是如何使这些元素可破坏" ?

This might be a reason of why I have some problems when switching between the scenes, so the question is how to make these elements "destroyable"?

推荐答案

'DontDestroyOnLoad'意味着他们不会自动对其进行管理.因此,如果您想销毁它,应该像

'DontDestroyOnLoad' It means that they won't manage it automatically. so if you want to destroy it, you should destroy manually like

GameObject.Destroy(GameObject.Find("TextureBufferCamera"));

GameObject.Destroy(GameObject.Find("TextureBufferCamera"));

这篇关于DontDestroyOnLoad-如何销毁?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 16:43