r2mods/ilspy_dump/ror2_csproj/DestroyOnSoundEnd.cs

21 lines
323 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine;
[RequireComponent(typeof(AudioSource))]
public class DestroyOnSoundEnd : MonoBehaviour
{
private AudioSource audioSource;
private void Awake()
{
audioSource = GetComponent<AudioSource>();
}
private void Update()
{
if (!audioSource.isPlaying)
{
Object.Destroy(base.gameObject);
}
}
}