/* * [SerializeField] * [Range(1f,3f)] * private float ParticlesLifeTime = 2f; */ public override void PlaySFX(SoundFxPair clip) { if (clip != null) { AudioManager.Instance.PlaySFX(clip.Clip, clip.Volume); } }
public virtual void Explode(SoundFxPair clip, ParticleSystem ps, Vector3 position) { PlaySFX(clip); PlayParticleSys(ps, position); OnExplosionFinished(this, EventArgs.Empty); if (ExplosionComplete != null) { ExplosionComplete(); } }
public void PlayMusic(SoundFXType sfxType) { SoundFxPair pair = audioCollection.GetMusicPair(sfxType); if (pair == null) { return; } AudioClip clip = pair.Clip; if (musicSource.isPlaying && musicSource.clip == clip) { return; } musicSource.clip = clip; musicSource.loop = true; musicSource.volume = pair.Volume; musicSource.Play(); }
public void PlaySFX(SoundFXType sfxType) { SoundFxPair pair = audioCollection.GetSfxPair(sfxType); if (pair == null) { return; } if (!sfxSource.isPlaying && pair != null) { sfxSource.clip = pair.Clip; sfxSource.volume = pair.Volume; sfxSource.Play(); } else { PlayDynamicSoundFX(pair.Clip, pair.Volume); } }
public abstract void PlaySFX(SoundFxPair clip);
public AudioClip GetMusic(SoundFXType type) { SoundFxPair pair = AmbienceClips.Find(x => x.Type == type); return(pair != null ? pair.Clip : null); }