private void Awake() { if (_instance != null && _instance != this) { Destroy(this.gameObject); return; } _instance = this; DontDestroyOnLoad(gameObject); //Set SoundManager to DontDestroyOnLoad so that it won't be destroyed when reloading our scene. Main.onSceneChange.AddListener(SceneChanged); UISettingsManager.onFXVolumeChange.AddListener(AdjustFXVolume); UISettingsManager.onMusicVolumeChange.AddListener(AdjustMusicVolume); }
private void Start() { soundPlayer = SoundPlayer._instance; soundPlayer.PlayMusic(backgroundSound); }