11 lines
211 B
C#
11 lines
211 B
C#
using UnityEngine;
|
|
|
|
public class PlaySoundAndDestroy : MonoBehaviour
|
|
{
|
|
private void OnEnable()
|
|
{
|
|
var time = GetComponent<AudioSource>().clip.length;
|
|
Destroy(gameObject, time);
|
|
}
|
|
}
|