Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 private void Start()
 {
     soundPlayer = SoundPlayer._instance;
     soundPlayer.PlayMusic(backgroundSound);
 }