@文心快码BaiduComatedontdestroyonload only works for root gameobjects or components on root game 文心快码BaiduComate 回答 DontDestroyOnLoad的功能: DontDestroyOnLoad是Unity中的一个方法,用于指定某个游戏对象或组件在加载新场景时不应被销毁。这在需要跨场景保持某些数据或对象时非常有用,比如玩家信息、UI管理...
CallObject.DontDestroyOnLoadto preserve an Object during scene loading. If the target Object is a component orGameObject, Unity also preserves all of theTransform’s children.Object.DontDestroyOnLoadonly works for root GameObjects or components on root GameObjects.Object.DontDestroyOnLoaddoes not ...