using System.Collections; using System.Collections.Generic; using Newtonsoft.Json.Linq; using UnityEngine; public class EndSceneManager : MonoBehaviour { public TextAsset data; // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() { LevelLoader.Instance.Guards = new List(); LevelLoader.Instance.Doors = new List(); var text = data.ToString(); DialogManager.Instance.dialogTree = JObject.Parse(text)["dialog"] as JObject; DialogManager.Instance.StartDialog(GetComponent()); StartCoroutine(DoSomethingAfterOneSecond()); } IEnumerator DoSomethingAfterOneSecond() { yield return new WaitForSeconds(1f); // Code to run after 1 second DialogManager.Instance.gameObject.SetActive(true); } // Update is called once per frame void Update() { } }