using System.Collections; using UnityEngine; public class CampPlayAudio : MonoBehaviour { AudioSource audioSource; float audioTime = 0; //private void Awake() //{ // audioSource = GetComponent(); // if (audioSource) // { // audioTime = audioSource.clip.length; // } //} //private void OnEnable() //{ // if (audioSource) // { // audioSource.Play(); // StartCoroutine(Stop()); // } //} //IEnumerator Stop() //{ // yield return new WaitForSeconds(audioTime); // gameObject.SetActive(false); //} }