FiE-Game/Assets/Cinema Director/Cutscene Items/Global Items/AudioSource/PlayClipAtPointAudioEvent.cs
2023-07-27 00:47:00 +05:00

29 lines
No EOL
787 B
C#

// Cinema Suite
using UnityEngine;
namespace CinemaDirector
{
/// <summary>
/// Event to trigger playing an audio clip at a point in space.
/// </summary>
[CutsceneItemAttribute("Audio Source", "Play Clip At Point", CutsceneItemGenre.GlobalItem)]
public class PlayClipAtPointAudioEvent : CinemaGlobalEvent
{
// The Audio Clip to be played.
public AudioClip Clip;
// The position to be played at.
public Vector3 Position;
// The volume.
public float VolumeScale = 1f;
/// <summary>
/// Trigger the audio clip to be played at a position.
/// </summary>
public override void Trigger()
{
AudioSource.PlayClipAtPoint(Clip, Position, VolumeScale);
}
}
}