Add ability to note predictions on the side
This commit is contained in:
@@ -93,7 +93,14 @@ public class DoorManager : MonoBehaviour, IDescribable
|
||||
|
||||
public string GetDescribeName()
|
||||
{
|
||||
return mod;
|
||||
if (!string.IsNullOrEmpty(mod))
|
||||
{
|
||||
return mod;
|
||||
}
|
||||
else
|
||||
{
|
||||
return "normal door";
|
||||
}
|
||||
}
|
||||
|
||||
public string GetDescription()
|
||||
|
||||
@@ -144,7 +144,14 @@ public class GuardManager : MonoBehaviour, IDescribable
|
||||
|
||||
public string GetDescribeName()
|
||||
{
|
||||
return mod;
|
||||
if (!string.IsNullOrEmpty(mod))
|
||||
{
|
||||
return mod;
|
||||
}
|
||||
else
|
||||
{
|
||||
return "plain guard";
|
||||
}
|
||||
}
|
||||
|
||||
public string GetDescription()
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Utils;
|
||||
|
||||
public class StatusManager : Singleton<StatusManager>
|
||||
@@ -32,12 +33,11 @@ public class StatusManager : Singleton<StatusManager>
|
||||
|
||||
PopulatePanel(doorPanelThoughts, doorPrefab, LevelLoader.Instance.Doors.Cast<IDescribable>().ToList(),true, LevelLoader.Instance.GlobalModifier == "HIDE");
|
||||
PopulatePanel(guardPanelThoughts, guardPrefab, LevelLoader.Instance.Guards.Cast<IDescribable>().ToList(), true, false);
|
||||
|
||||
//hide side pannel if cup global mod, or if only one guard
|
||||
//add fallback to getdescribename
|
||||
//actually implement the setting of predictions
|
||||
}
|
||||
|
||||
private Color[] colors = new Color[] { Color.white, Color.green, Color.red };
|
||||
private Dictionary<GameObject, int> cycles = new Dictionary<GameObject, int>();
|
||||
|
||||
private void PopulatePanel(Transform panel, GameObject template, List<IDescribable> items, bool interactableType, bool hide)
|
||||
{
|
||||
foreach (Transform child in panel)
|
||||
@@ -70,6 +70,12 @@ public class StatusManager : Singleton<StatusManager>
|
||||
{
|
||||
titleMesh.text = item.GetDescribeName();
|
||||
descMesh.text = "Click to set prediction";
|
||||
cycles[obj] = 0;
|
||||
|
||||
obj.GetComponentInChildren<Button>().onClick.AddListener(() =>
|
||||
{
|
||||
obj.GetComponent<Image>().color = colors[++cycles[obj]%3];
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user