Ejemplo n.º 1
0
        public static void SetupAudio(nAudio a)
        {
            if (!_soundReady) {
            _bop = (AudioClip)Resources.Load("audio/bop");
            _boop = (AudioClip)Resources.Load("audio/boop");
            _playerAudio = a.Source();
            _playerAudio.loop = false;
            _playerAudio.clip = _boop;
            _playerAudio.volume = 0.5f;
            _aiAudio = a.Source();
            _aiAudio.loop = false;
            _aiAudio.clip = _bop;
            _aiAudio.volume = 0.5f;
            _wallAudio = a.Source();
            _wallAudio.loop = false;
            _wallAudio.clip = _bop;
            _wallAudio.pitch = 1.5f;
            _wallAudio.volume = 0.5f;

            /* Setup channel for stars */
            a.Channel(COLLECT_STAR_CHANNEL, 6);
            a.Register(COLLECT_STAR_CHANNEL, COLLECT_STAR_BING1, "audio/star1");
            a.Register(COLLECT_STAR_CHANNEL, COLLECT_STAR_BING2, "audio/star2");
            a.Register(COLLECT_STAR_CHANNEL, COLLECT_STAR_BING3, "audio/star3");
            a.Register(COLLECT_STAR_CHANNEL, COLLECT_STAR_BING4, "audio/star4");

            /* Setup channel for win lose sounds */
            a.Channel(WIN_LOSE_CHANNEL, 1);
            a.Register(WIN_LOSE_CHANNEL, WIN_SOUND, "audio/win");
            a.Register(WIN_LOSE_CHANNEL, LOSE_SOUND, "audio/lose");

            /* Music */
            a.Channel(MUSIC_CHANNEL, 1);
            a.Register(MUSIC_CHANNEL, MUSIC_0, "audio/theme");
            a.Repeat(MUSIC_CHANNEL, MUSIC_0, 0.1f);

            _soundReady = true;
              }
        }
Ejemplo n.º 2
0
 /** Reload using a new audio parent */
 public void Reload(nAudio parent)
 {
     for (var i = 0; i < _workers.Length; ++i) {
     _workers[i] = parent.Source();
       }
 }
Ejemplo n.º 3
0
 /** Init things that need to be scene specific */
 public void Init(GameObject parent)
 {
     Audio = new nAudio(parent);
 }
Ejemplo n.º 4
0
 /** Create with worker count */
 public nAudioChannel(nAudio parent, int workers)
 {
     _workers = new AudioSource[workers];
       Reload(parent);
 }