32 lines
650 B
C#
32 lines
650 B
C#
using System.Collections;
|
|
using UnityEngine;
|
|
|
|
public class CampPlayAudio : MonoBehaviour
|
|
{
|
|
AudioSource audioSource;
|
|
float audioTime = 0;
|
|
//private void Awake()
|
|
//{
|
|
// audioSource = GetComponent<AudioSource>();
|
|
// 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);
|
|
//}
|
|
}
|