18 lines
500 B
C#
18 lines
500 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class SFXLibraryController : MonoBehaviour
|
|
{
|
|
[SerializeField] List<AudioClip> UISoundFX;
|
|
[SerializeField] AudioSource audioSource;
|
|
|
|
public void PlaySound(int soundIndex) {
|
|
if (soundIndex > -1 && soundIndex < UISoundFX.Count) {
|
|
audioSource.PlayOneShot(UISoundFX[soundIndex]);
|
|
} else {
|
|
Debug.LogError("Sound index outside of UISoundFX range!");
|
|
}
|
|
}
|
|
}
|