Hi!
I have a problem in using of DontDestroyOnLoad method.
I have empty gameObject (SciptObject) with SomeScript in it. Script has public variable “Button”, this variable is filled in Unity editor (dragged button to an empty field in script properties in Inspector window). For this script I`m using DontDestroyOnLoad:
DontDestroyOnLoad(this.gameObject);
After some actions I`m loading another scene and the loading the first scene and one more ScriptObject is created with empty variable Button.
Is it posible to destroy new ScriptObject and use the first one?
Thanks!