示例#1
0
        private void ensureComponents()
        {
            Debug.Log("Creating injector game object ...");

            if (_gameObject == null)
            {
                _gameObject      = new GameObject();
                _gameObject.name = "CSLMusicMod_GO";
            }

            if (_injector == null)
            {
                _injector = _gameObject.AddComponent <MusicInjector>();
            }

            // Create settings
            if (_settings == null)
            {
                _settings = _gameObject.AddComponent <SettingsManager>();
            }

            // Create the music list
            if (_music == null)
            {
                _music = _gameObject.AddComponent <MusicManager>();
            }

            // Create the converter
            if (_conversion == null)
            {
                _conversion = _gameObject.AddComponent <ConversionManager>();
            }

            //Create music player
            if (_musicplayer == null)
            {
                _musicplayer = _gameObject.AddComponent <BackgroundMusicPlayer>();
            }

            // Create folders
            _gameObject.GetComponent <MusicManager>().CreateMusicFolder();

            // Load the settings
            _gameObject.GetComponent <SettingsManager>().LoadModSettings();

            //Add audio watcher to player
            _musicplayer.AudioWatcher = _injector.AudioWatcher;
        }
示例#2
0
        private void ensureComponents()
        {
            Debug.Log("Creating injector game object ...");

            if (_gameObject == null)
            {
                _gameObject = new GameObject();
                _gameObject.name = "CSLMusicMod_GO";
            }

            if (_injector == null)
            {
                _injector = _gameObject.AddComponent<MusicInjector>();
            }

            // Create settings
            if (_settings == null)
            {
                _settings = _gameObject.AddComponent<SettingsManager>();
            }

            // Create the music list
            if (_music == null)
                _music = _gameObject.AddComponent<MusicManager>();

            // Create the converter
            if (_conversion == null)
                _conversion = _gameObject.AddComponent<ConversionManager>();

            //Create music player
            if (_musicplayer == null)
                _musicplayer = _gameObject.AddComponent<BackgroundMusicPlayer>();

            // Create folders
            _gameObject.GetComponent<MusicManager>().CreateMusicFolder();

            // Load the settings
            _gameObject.GetComponent<SettingsManager>().LoadModSettings();

            //Add audio watcher to player
            _musicplayer.AudioWatcher = _injector.AudioWatcher;
        }