public static void PlayOneShot(this AudioSource src, SoundPreset preset, float volumeScale = 1f, bool overridePitch = true) { if (preset) { preset.PlayThisOneshot(src, overridePitch, volumeScale); } }
public static void PlayOneshot(AudioSource src, SoundPreset sp) { if (src && sp) { sp.PlayThisOneshot(src, true); } else { Debug.LogWarning("Audio source or SoundPreset is null."); } }