Mark collection as 'don't destroy on load' #12
Replies: 1 comment 2 replies
-
Collection object is being destroyed before entering playmode or during build process (see https://github.com/neon-age/Smart-Hierarchy/blob/master/Collections/DetachOnBuildProcess.cs. This mean that any attached component will be stripped from build. Should I add an option like "Keep Transform Hierarchy" for the cases where transform overhead is not true (eg. collection of static objects/managers)? Another thing that comes to my mind is "Add Components To Root Children" which will copy/paste components to root children during scene processing. Though it's harder to implement nicely, and I'm not sure if that's a good idea.. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Right now, when I have a 'don't destroy on load' object under a collection, I get the following warning from Unity.
DontDestroyOnLoad only works for root GameObjects or components on root GameObjects. UnityEngine.Object:DontDestroyOnLoad(Object)
Would it be possible to allow us the option to mark a collection as being 'persistent' so that everything under that collection is marked as DDOL?
Edit: Right after typing this, I did see that the collection object is just a gameobject that I can add components to, so I could as well put a DDOL script on it! If no further discussion is deemed necessary, this can be closed :)
Beta Was this translation helpful? Give feedback.
All reactions