using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Playables;
using UnityEngine.Timeline;

public class SignalReceiverWithDialogue  : MonoBehaviour, INotificationReceiver
{
    public SignalAssetEventPair signalAssetEventPairs;

    //Allows for custom signal recievers in timeline which can hold parameter
    //as well as executing code per the data in parameter
    [Serializable]
    public class SignalAssetEventPair
    {
        public SignalAsset signalAsset;

        [Serializable]
        public class ParameterizedEvent : UnityEvent<bool> { }
    }

    public void OnNotify(Playable origin, INotification notification, object context)
    {
        if(notification is ParameterizedEmitter<DialogueData> boolEmitter)
        {
            DialogueData test = boolEmitter.parameter;
            FindObjectOfType<CinematicDialogueManager>().StartDialogue(test);
        }
    }
}
