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

public class TutorialMessageController : MonoBehaviour
{
    [SerializeField] List<string> keyTut;
    [SerializeField] List<GameObject> messagesTut;

    [SerializeField] GameObject textPrefab;
    GameObject activeMessage = null;
    Dictionary<string, GameObject> messages = new Dictionary<string, GameObject>();

    private void Awake()
    {
        Camera.main.GetComponent<BaseCameraController>().SetUserControlEnabled(false);
        
        //create Dict with Structs
        for (int i = 0; i < keyTut.Count; i++)
        {
            messages.Add(keyTut[i],messagesTut[i]);
        }
    }

    public void ActivateTutorial(string tutorialType)
    {
        if ( activeMessage != null)
        {
            activeMessage.SetActive(false);
        }
        if ( tutorialType == "return")
        {
            SceneLoader.instance.LoadScene("Forest");
            return;
        }
        activeMessage = messages[tutorialType];
        activeMessage.SetActive(true);
    }

}