mirror of
https://github.com/appen-isen/jeu-sans-image.git
synced 2026-03-18 21:50:42 +01:00
26 lines
560 B
C#
26 lines
560 B
C#
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// A triggerable sound. Trigger plays the sound.
|
|
/// </summary>
|
|
public class TriggerableSound : ITriggerable
|
|
{
|
|
[SerializeField] AudioClip audioSource;
|
|
|
|
public override void Trigger()
|
|
{
|
|
if (audioSource != null)
|
|
{
|
|
SoundManager.Instance.PlaySoundAt(transform.position, audioSource);
|
|
}
|
|
}
|
|
|
|
public override void Trigger(Vector3 position)
|
|
{
|
|
if (audioSource != null)
|
|
{
|
|
SoundManager.Instance.PlaySoundAt(position, audioSource);
|
|
}
|
|
}
|
|
}
|