using System.Collections.Generic; using UnityEngine; // Controls the Tutorial Messages. Activates the corresponding tutorial message // and hides all other ones on button click. 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]); } } // Called by the Tutorial Buttons 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); } }