public static void PlayPurchaseRejectedSound(this BuyCubeBehaviour target) { if (CurrentUserInfo.IsSoundEnabled) { target .GetComponents <AudioSource>() .Single(a => a.clip.name == "purchase_rejected") .Play(); } }
public static void PlayBuyCubeSound(this BuyCubeBehaviour target) { if (CurrentUserInfo.IsSoundEnabled) { target .GetComponents <AudioSource>() .Single(a => a.clip.name == "buy_cube") .PlayEvenIfDestroyed(); } }