Esempio n. 1
0
 public void StopOnLoop(eSoundId id)
 {
     if (_soundSource.isPlaying && _soundSource.clip == soundStorage.Get(id))
     {
         _soundSource.Stop();
     }
 }
        public void Play(eSoundId id, Transform target)
        {
            PooledObject snd = objPrefabSounds[(int)id].Instanciate <PooledObject>();

            ((SoundChunk)snd).Play(target);
            snd.transform.gameObject.SetActive(true);
        }
Esempio n. 3
0
 public void PlaySound(eSoundId id)
 {
     //if (_soundSource.isPlaying)
     //	return;
     //_soundSource.clip = soundStorage.Get(id);
     //_soundSource.Play();
     AudioSource.PlayClipAtPoint(soundStorage.Get(id), Vector3.zero);
 }
Esempio n. 4
0
    public AudioClip Get(eSoundId id)
    {
        Debug.Assert(soundSrcs.Length > 0, "No soundSource data!");
        if (dicSounds.Count == 0)
        {
            GenerateDictionary();
        }

        return(dicSounds[id]);
    }
Esempio n. 5
0
 public void PlayOnDelay(eSoundId id, float delayTime)
 {
     if (_soundSource.isPlaying)
     {
         return;
     }
     _soundSource.clip = soundStorage.Get(id);
     _soundSource.loop = true;
     _soundSource.Play();
 }
Esempio n. 6
0
 public int GetDuration(eSoundId _id)
 {
     return(list_soundeffect[(int)_id].Duration.Milliseconds);
 }
Esempio n. 7
0
 public SoundState GetState(eSoundId _id)
 {
     return(list_effectInstant[(int)_id].State);
 }
Esempio n. 8
0
 public void Stop(eSoundId _id)
 {
     list_effectInstant[(int)_id].Stop();
 }
Esempio n. 9
0
 public void Play(eSoundId _id)
 {
     list_effectInstant[(int)_id].Play();
 }
Esempio n. 10
0
 public SoundEffectInstance GetSoundEffectInstance(eSoundId _id)
 {
     return(list_effectInstant[(int)_id]);
 }
Esempio n. 11
0
 public void Stop(eSoundId _id)
 {
     list_effectInstant[(int)_id].Stop();
 }
Esempio n. 12
0
 public void Play(eSoundId _id)
 {
     list_effectInstant[(int)_id].Play();
 }
Esempio n. 13
0
 public SoundState GetState(eSoundId _id)
 {
     return list_effectInstant[(int)_id].State;
 }
Esempio n. 14
0
 public SoundEffectInstance GetSoundEffectInstance(eSoundId _id)
 {
     return list_effectInstant[(int)_id];
 }
Esempio n. 15
0
 public int GetDuration(eSoundId _id)
 {
     return list_soundeffect[(int)_id].Duration.Milliseconds;
 }
Esempio n. 16
0
 public void PlayOnLoop(eSoundId id)
 {
     _soundSource.clip = soundStorage.Get(id);
     _soundSource.loop = true;
     _soundSource.Play();
 }