unity dontdestroyonload
Code Example - unity dontdestroyonload
private void Awake(){
if(instance == null){
instance = this;
DontDestroyOnLoad(instance);
}
else{
Destroy(gameObject)
}
}
unity don't destroy on load
UnityEngine.Object.DontDestroyOnLoad(gameObject);