using System.Collections;
using UnityEngine.Playables;
using UnityEngine;

public class MusicSourceController : MonoBehaviour
{
    [SerializeField] private float playMusicPoint;
    [SerializeField] private PlayableDirector playableDirector;
    [SerializeField] private AudioSource audioSource;
    IEnumerator Start()
    {
        float currentVolume = audioSource.volume;
        audioSource.volume = 0;
        yield return new WaitForSeconds(playMusicPoint);
        audioSource.Play();
        yield return new WaitForSeconds((float)playableDirector.duration - playMusicPoint);
        audioSource.volume = currentVolume;
    }
}
