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