1
0
mirror of https://github.com/Memorix101/UnityXNA/ synced 2024-12-30 15:25:35 +01:00
UnityXNA/Assets/Scripts/AudioSourceController.cs

13 lines
338 B
C#
Raw Permalink Normal View History

using System.Collections;
using UnityEngine;
public class AudioSourceController : MonoBehaviour
{
IEnumerator Start()
{
// Wait for the audio clip to finish playing, then delete the game object
yield return new WaitForSeconds(GetComponent<AudioSource>().clip.length);
Destroy(this.gameObject);
}
}