ZoeAppClass/Assets/Jogos/Aula09/A9Grammar/Scripts/A9GAudioSystem.cs

27 lines
518 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class A9GAudioSystem : MonoBehaviour
{
public static A9GAudioSystem instance;
private AudioSource thisAS;
public AudioClip wrong, correct;
private void Awake()
{
instance = this;
thisAS = GetComponent<AudioSource>();
}
public void PlayWrong()
{
thisAS.PlayOneShot(wrong, .5f);
}
public void PlayCorrect()
{
thisAS.PlayOneShot(correct, .5f);
}
}