mirror of
https://github.com/Memorix101/UnityXNA/
synced 2024-12-30 15:25:35 +01:00
13 lines
316 B
C#
13 lines
316 B
C#
|
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(audio.clip.length);
|
|||
|
Destroy(this.gameObject);
|
|||
|
}
|
|||
|
}
|