rabidus-test/Assets/MonumentPreviewSound.cs

20 lines
374 B
C#
Raw Permalink Normal View History

2023-10-23 11:19:20 +03:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MonumentPreviewSound : MonoBehaviour
{
private SoundEmitter _emitter;
2023-10-23 11:19:20 +03:00
private void Awake()
{
_emitter = GetComponent<SoundEmitter>();
2023-10-23 11:19:20 +03:00
}
public void PlaySound(AudioClip sound)
2023-10-23 11:19:20 +03:00
{
_emitter.Sound.Clip = sound;
_emitter.Play();
2023-10-23 11:19:20 +03:00
}
}