-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
Sound Effects For different impacts
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using UnityEngine; | ||
|
||
|
||
[RequireComponent(typeof(AudioSource))] | ||
public class ImpactAudioPlayer : MonoBehaviour | ||
{ | ||
private AudioSource audioSource; | ||
private void OnEnable() | ||
{ | ||
audioSource = GetComponent<AudioSource>(); | ||
audioSource?.Play(); | ||
Debug.Log($"Playing with {audioSource}"); | ||
} | ||
private void OnDisable() | ||
{ | ||
audioSource?.Stop(); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.