don't destroy on load duplicate unity code example
Example: unity clone don't destroy on scene load
private static Player playerInstance;
void Awake(){
DontDestroyOnLoad (this);
if (playerInstance == null) {
playerInstance = this;
}
else {
DestroyObject(gameObject);
}
}