mirror of
https://github.com/tym1116/BH3.git
synced 2025-12-16 16:34:41 +01:00
25 lines
512 B
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|