using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ToyotaMusicVariant : MonoBehaviour
{
    public AudioSource audioSource;
    public List<AudioClip> clips;
    public int current_id;

    public void Switchear()
    {
        if (clips[this.current_id] == null)
        {
            audioSource.Stop();
            current_id = 0;
        }
        else
        {
            audioSource.Stop();
            this.audioSource.PlayOneShot(clips[this.current_id]);
            current_id++;
            if (current_id >= clips.Count)
            {
                current_id = 0;
            }
        }
    }
}
