unity dontdestroyon reload code example
Example: unity dontdestroyonload
private void Awake(){
if(instance == null){
instance = this;
DontDestroyOnLoad(instance);
}
else{
Destroy(gameObject)
}
}
private void Awake(){
if(instance == null){
instance = this;
DontDestroyOnLoad(instance);
}
else{
Destroy(gameObject)
}
}