private void PlaySFX(EProjectileSFXType projectileSFXType) { AudioEntry sfxEntry = m_ProjectileSFX.GetSFX(m_ProjectileType, projectileSFXType); if (sfxEntry != null) { m_AudioSource.clip = sfxEntry.m_Clip; m_AudioSource.volume = sfxEntry.m_Volume; m_AudioSource.loop = projectileSFXType == EProjectileSFXType.Movement; m_AudioSource.Play(); } }
public AudioEntry GetSFX(EProjectileType projectileType, EProjectileSFXType projectileSFXType) { switch (projectileSFXType) { case EProjectileSFXType.Movement: return(GetMovementSFX(projectileType)); case EProjectileSFXType.Impact: return(GetImpactSFX(projectileType)); case EProjectileSFXType.Destroy: return(GetDestroySFX(projectileType)); default: return(null); } }