Implement final scene
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user