using UnityEngine;
using UnityEngine.Playables;

public class Grainy : MonoBehaviour, IInteractable
{

    [SerializeField] private PlayableDirector director;
    public Dialogue dialogue;
    private string[] lines;
    private bool hasInteracted;

    public void Interact()
    {
        if(!hasInteracted)
        {
            hasInteracted = true;
            lines = new string[]{
                "Hmm… Grainy Palace is almost complete!",
                "All I'm missing now is…",
                "...A friend.",
                "...And some buried treasure!!!"
            };
            dialogue.StartDialogue(lines, "Child (Old Man)", this.gameObject, "JumpOutOfBox");
        }
        else
        {
            lines = new string[]{
                "It's my awesome sand castle!"
            };
            dialogue.StartDialogue(lines);
        }
    }

    public void JumpOutOfBox()
    {
        director.Play();
    }

}
