rabidus-test/Assets/MonumentPreviewSound.cs

20 lines
360 B
C#
Raw 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 AudioSource _source;
private void Awake()
{
_source = GetComponent<AudioSource>();
}
public void PlaySound(AudioClip clip)
{
_source.clip = clip;
_source.Play();
}
}