done for the night
This commit is contained in:
@@ -2,10 +2,22 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Utils;
|
||||
|
||||
public class EndSceneManager : MonoBehaviour
|
||||
public class EndSceneManager : Singleton<EndSceneManager>
|
||||
{
|
||||
public TextAsset data;
|
||||
|
||||
|
||||
public bool isPos;
|
||||
|
||||
public Image kingRend;
|
||||
|
||||
public Sprite hap;
|
||||
public Sprite sad;
|
||||
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
@@ -14,12 +26,12 @@ public class EndSceneManager : MonoBehaviour
|
||||
var text = data.ToString();
|
||||
DialogManager.Instance.dialogTree = JObject.Parse(text)["dialog"] as JObject;
|
||||
DialogManager.Instance.StartDialog(GetComponent<GuardManager>());
|
||||
|
||||
isPos = Random.Range(0f, 1f) > 0.5f;
|
||||
StartCoroutine(DoSomethingAfterOneSecond());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
IEnumerator DoSomethingAfterOneSecond()
|
||||
{
|
||||
@@ -28,6 +40,11 @@ public class EndSceneManager : MonoBehaviour
|
||||
// Code to run after 1 second
|
||||
DialogManager.Instance.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
public void SetFace()
|
||||
{
|
||||
kingRend.sprite = isPos ? hap : sad;
|
||||
}
|
||||
|
||||
|
||||
// Update is called once per frame
|
||||
|
||||
Reference in New Issue
Block a user