using UnityEngine;

[RequireComponent(typeof(AudioSource))]
public class SelfDestructAfterPlaying : MonoBehaviour {
    private AudioSource Source;

    private void Awake() {
        Source = GetComponent<AudioSource>();
    }

    private void LateUpdate() {
        if (!Source.isPlaying) {
            Destroy(gameObject);
        }
    }
}
