// Use this for initialization void Awake() { if (audioSourcesInstance == null) { audioSourcesInstance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
// Use this for initialization void Awake() { if (instance == null) { instance = this; audioSources = GetComponents <AudioSource>(); DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }