Esempio n. 1
0
        void Awake()
        {
            _soundMap = new Dictionary <string, SoundSchema>();
            _sb       = new StringBuilder();

            //create channel
            _BGMChannel             = GameObjectUtil.Create <AudioSource>("BGM_Channel", transform);
            _BGMChannel.playOnAwake = false;
            _BGMChannel.loop        = true;

            _SFXChannels = new List <AudioSource>();
            for (int i = 0; i < maxChannels; ++i)
            {
                AudioSource ch = GameObjectUtil.Create <AudioSource>("SFX_Channel" + i, transform);
                ch.playOnAwake = false;
                _SFXChannels.Add(ch);
            }

            _soundList = GetComponent <SoundList>();
            if (_soundList != null)
            {
                SetSoundList(_soundList);
            }
        }