Files
the-peoples-messenger/Assets/Scripts/EndSceneManager.cs
T
2026-08-29 20:44:27 +01:00

39 lines
988 B
C#

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<GuardManager>();
LevelLoader.Instance.Doors = new List<DoorManager>();
var text = data.ToString();
DialogManager.Instance.dialogTree = JObject.Parse(text)["dialog"] as JObject;
DialogManager.Instance.StartDialog(GetComponent<GuardManager>());
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()
{
}
}