rabidus-test/Assets/MonumentPreviewSound.cs

20 lines
374 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MonumentPreviewSound : MonoBehaviour
{
private SoundEmitter _emitter;
private void Awake()
{
_emitter = GetComponent<SoundEmitter>();
}
public void PlaySound(AudioClip sound)
{
_emitter.Sound.Clip = sound;
_emitter.Play();
}
}