using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Random = UnityEngine.Random;

public class PlayerAudioHandler : MonoBehaviour
{

    [SerializeField] private List<AudioClip> _jump;
    [SerializeField] private AudioSource _jumpSource;
    [SerializeField] private List<AudioClip> _hit;
    [SerializeField] private AudioSource _hitSource;
    [SerializeField] private List<AudioClip> _ribbit;
    [SerializeField] private AudioSource _ribbitSource;
    [SerializeField] private List<AudioClip> _lilypad;
    [SerializeField] private AudioSource _lilypadSource;
    [SerializeField] private List<AudioClip> _rock;
    [SerializeField] private AudioSource _rockSource;
    [SerializeField] private List<AudioClip> _duck;
    [SerializeField] private AudioSource _duckSource;
    [SerializeField] private List<AudioClip> _slurp;
    [SerializeField] private AudioSource _slurpSource;

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }
    public void PlayJump(){
        var clip = Random.Range(0, _jump.Count);
        _jumpSource.clip = _jump[clip];
        _jumpSource.Play();
    }
    public void PlayHit(){
        var clip = Random.Range(0, _hit.Count);
        _hitSource.clip = _hit[clip];
        _hitSource.Play();
    }
    public void PlayRibbit(){
        var clip = Random.Range(0, _ribbit.Count);
        _ribbitSource.clip = _ribbit[clip];
        _ribbitSource.Play();
    }
    public void PlayLilypad(){
        var clip = Random.Range(0, _lilypad.Count);
        _lilypadSource.clip = _lilypad[clip];
        _lilypadSource.Play();
    }
    public void PlayRock(){
        var clip = Random.Range(0, _rock.Count);
        _rockSource.clip = _rock[clip];
        _rockSource.Play();
    }
    public void PlayDuck(){
        var clip = Random.Range(0, _duck.Count);
        _duckSource.clip = _duck[clip];
        _duckSource.Play();
    }
    public void PlaySlurp(){
        var clip = Random.Range(0, _slurp.Count);
        _slurpSource.clip = _slurp[clip];
        _slurpSource.Play();
    }
}
