27 lines
473 B
C#
27 lines
473 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class SoundManager : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private AudioSource audioSource;
|
|
[SerializeField]
|
|
private AudioClip bg;
|
|
void Start()
|
|
{
|
|
audioSource=GetComponent<AudioSource>();
|
|
}
|
|
|
|
public void playBg()
|
|
{
|
|
audioSource.clip = bg;
|
|
audioSource.Play();
|
|
}
|
|
public void stopBg()
|
|
{
|
|
audioSource.Stop();
|
|
}
|
|
|
|
}
|