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); }
public void PlaySound(eSoundId id) { //if (_soundSource.isPlaying) // return; //_soundSource.clip = soundStorage.Get(id); //_soundSource.Play(); AudioSource.PlayClipAtPoint(soundStorage.Get(id), Vector3.zero); }
public AudioClip Get(eSoundId id) { Debug.Assert(soundSrcs.Length > 0, "No soundSource data!"); if (dicSounds.Count == 0) { GenerateDictionary(); } return(dicSounds[id]); }
public void PlayOnDelay(eSoundId id, float delayTime) { if (_soundSource.isPlaying) { return; } _soundSource.clip = soundStorage.Get(id); _soundSource.loop = true; _soundSource.Play(); }
public int GetDuration(eSoundId _id) { return(list_soundeffect[(int)_id].Duration.Milliseconds); }
public SoundState GetState(eSoundId _id) { return(list_effectInstant[(int)_id].State); }
public void Stop(eSoundId _id) { list_effectInstant[(int)_id].Stop(); }
public void Play(eSoundId _id) { list_effectInstant[(int)_id].Play(); }
public SoundEffectInstance GetSoundEffectInstance(eSoundId _id) { return(list_effectInstant[(int)_id]); }
public SoundState GetState(eSoundId _id) { return list_effectInstant[(int)_id].State; }
public SoundEffectInstance GetSoundEffectInstance(eSoundId _id) { return list_effectInstant[(int)_id]; }
public int GetDuration(eSoundId _id) { return list_soundeffect[(int)_id].Duration.Milliseconds; }
public void PlayOnLoop(eSoundId id) { _soundSource.clip = soundStorage.Get(id); _soundSource.loop = true; _soundSource.Play(); }