using System.Collections; using System.Collections.Generic; using System.Linq; using TMPro; using UnityEngine; using UnityEngine.UI; using Utils; public class StatusManager : Singleton { public Transform doorPanel; public Transform doorPanelThoughts; public GameObject doorPrefab; public Transform guardPanel; public Transform guardPanelThoughts; public GameObject guardPrefab; // Start is called once before the first execution of Update after the MonoBehaviour is created void Start() { } // Update is called once per frame void Update() { } public void PopulatePanels() { bool isHide = LevelLoader.Instance.GlobalModifier == "HIDE"; PopulatePanel(doorPanel, doorPrefab, LevelLoader.Instance.Doors.Cast().ToList().Shuffle(),false, isHide); PopulatePanel(guardPanel, doorPrefab, LevelLoader.Instance.Guards.Cast().ToList().Shuffle(), false, isHide); PopulatePanel(doorPanelThoughts, doorPrefab, LevelLoader.Instance.Doors.Cast().ToList(),true, false); PopulatePanel(guardPanelThoughts, doorPrefab, LevelLoader.Instance.Guards.Cast().ToList(), true, false); } private Color[] colors = new Color[] { Color.white, Color.green, Color.red }; private Dictionary cycles = new Dictionary(); private void PopulatePanel(Transform panel, GameObject template, List items, bool interactableType, bool hide) { foreach (Transform child in panel) { Destroy(child.gameObject); } foreach (IDescribable item in items) { var obj = Instantiate(template, panel); var titleMesh = obj.transform.FindChildRecursive("TITLE").GetComponent(); var descMesh = obj.transform.FindChildRecursive("DESC").GetComponent(); if (!interactableType) { if (hide) { titleMesh.text = "???"; descMesh.text = "???"; } else { titleMesh.text = item.GetName(); descMesh.text = item.GetDescription(); } } else { titleMesh.text = item.GetDescribeName(); descMesh.text = "Click to set prediction"; cycles[obj] = 0; obj.GetComponentInChildren