FiE-Game/Assets/Cinema Director/Cutscene Items/Actor Items/AudioSource/StopAudioEvent.cs

23 lines
552 B
C#
Raw Permalink Normal View History

2023-07-26 21:47:00 +02:00
using UnityEngine;
using System.Collections;
namespace CinemaDirector
{
[CutsceneItemAttribute("Audio Source", "Stop Audio", CutsceneItemGenre.ActorItem)]
public class StopAudioEvent : CinemaActorEvent
{
public override void Trigger(GameObject actor)
{
if (actor != null)
{
AudioSource audio = actor.GetComponent<AudioSource>();
if (!audio)
{
return;
}
audio.Stop();
}
}
}
}