how to Undo DontDestroyOnLoad

Very obvious case:

  • Game starts,
  • Start screen Level is loaded and makes a GameObject undestroyable on Load Level,
  • another level is loaded and stores data in the GameObject, and another one and another one…
  • at some point the player clicks on the “reset” button (availabe in each level) to bring him back to the Start screen Level, where everything should be as it was right after the Game started.

Now, the logical thing would be to somehow undo the DontDestroyOnLoad state of that GameObject and then call Application.LoadLevel(“Start_screen_level”); .

But I just can´t find a way to undo DontDestroyOnLoad. Is there really no way to do this?
(It seems to be such a basic and logical thing to have.)

As I understand it, Destory makes the object for deletion at the end of the current frame. But you can use DestroyImmediate if that is not acceptable.

Also, did you consider manually resetting the object state instead of destroying it and then recreating it on restart? As in set all its fields to defaults or null, zero any collections it has, etc? Could net you a slight performance boost this way.