private void Awake() { if (instance) { Destroy(this.gameObject); } else { instance = this; DontDestroyOnLoad(this.gameObject); } }
// Use this for initialization void Start() { instance = this; DontDestroyOnLoad(gameObject); }