Exemplo n.º 1
0
        public override void OnLevelLoaded(LoadMode mode)
        {
            base.OnLevelLoaded(mode);

            //ensure it!
            ensureComponents();

            //Reload music
            _music.LoadMusicFiles();

            //Create ui
            if (_ui == null)
                _ui = _gameObject.AddComponent<MusicUI>();
        }
Exemplo n.º 2
0
        public override void OnLevelUnloading()
        {
            if (_gameObject != null)
                MonoBehaviour.Destroy(_gameObject);
            if (_injector != null)
                MonoBehaviour.Destroy(_injector);
            if (_ui != null)
                MonoBehaviour.Destroy(_ui);

            _gameObject = null;
            _injector = null;
            _ui = null;

            base.OnLevelUnloading();
        }
Exemplo n.º 3
0
 public void ReloadUI()
 {
     if (_ui != null)
     {
         MonoBehaviour.Destroy(_ui);
         _ui = _gameObject.AddComponent<MusicUI>();
     }
 }