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

public class Music_handler : MonoBehaviour {
    [SerializeField]
    AudioSource m_musicHandler;

    [SerializeField]
    AudioClip[] m_musiiki;

    // Start is called before the first frame update
    void Start() {
        m_musicHandler = GetComponent<AudioSource>();
    }
    
    public void loppuääni() {
        m_musicHandler.clip = m_musiiki[0];
        if (!m_musicHandler.isPlaying) {
            m_musicHandler.Play();
        }
    }

    public void scytheääni() {
        m_musicHandler.clip = m_musiiki[1];
        if (!m_musicHandler.isPlaying) {
            m_musicHandler.Play();
        }
    }
    
    public void osumaääni() {
        m_musicHandler.clip = m_musiiki[2];
        if (!m_musicHandler.isPlaying) {
            m_musicHandler.Play();
        }
    }
}