mirror of
https://github.com/FriendshipIsEpic/FiE-Game.git
synced 2024-11-30 00:48:00 +01:00
28 lines
659 B
C#
28 lines
659 B
C#
|
using UnityEngine;
|
||
|
using System.Collections;
|
||
|
|
||
|
namespace CinemaDirector
|
||
|
{
|
||
|
[CutsceneItemAttribute("Audio Source", "Play One Shot", CutsceneItemGenre.ActorItem)]
|
||
|
public class PlayOneShotAudioEvent : CinemaActorEvent
|
||
|
{
|
||
|
public AudioClip Clip;
|
||
|
public float VolumeScale = 1f;
|
||
|
|
||
|
public override void Trigger(GameObject actor)
|
||
|
{
|
||
|
if (actor != null)
|
||
|
{
|
||
|
AudioSource audio = actor.GetComponent<AudioSource>();
|
||
|
if (!audio)
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
audio.PlayOneShot(Clip, VolumeScale);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|