Files
BH3/Assets/Plugins/Assembly-CSharp-firstpass/CinemaDirector/PlayOneShotAudioEvent.cs
2025-08-13 09:26:42 +08:00

25 lines
512 B
C#

using UnityEngine;
namespace CinemaDirector
{
[CutsceneItem("Audio Source", "Play One Shot", new CutsceneItemGenre[] { CutsceneItemGenre.ActorItem })]
public class PlayOneShotAudioEvent : CinemaActorEvent
{
public AudioClip Clip;
public float VolumeScale = 1f;
public override void Trigger(GameObject actor)
{
if (actor != null)
{
AudioSource component = actor.GetComponent<AudioSource>();
if ((bool)component)
{
component.PlayOneShot(Clip, VolumeScale);
}
}
}
}
}