private void Awake() { var objs = GameObject.FindGameObjectsWithTag("Music"); if (objs.Length > 1) { Destroy(gameObject); return; } musicPlayer.Init(musicSource); DontDestroyOnLoad(gameObject); }
protected override void OnAwake() => musicPlayer.Init(musicSource);
private void Awake() => musicPlayer.Init(musicSource);