Answer the question
In order to leave comments, you need to log in
Unity dontdestroyonload how should it interact with the UI on the stage?
Good afternoon everyone!
Found the dontdestroyonload method to save the GameObject between scenes.
But Button != GameObject. Accordingly, I cannot apply it to a button in my UI.
The problem is that the button has a caroutine and doesn't work after being clicked for a while.
And in order to save this position, you need not to destroy the object when changing the scene.
I couldn't find anything other than dontdestroyonload , and I can't apply it to Button either.
Save-help!!!
Answer the question
In order to leave comments, you need to log in
Dontdestroyonload is essentially a crutch, it is better to use multiple scenes, dynamically loading and unloading them. You can pull the UI into a separate scene and always keep it active, since any game can have hundreds of levels and locations, but the UI will always be the same for them.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question