blob: 62415e2c4bbc8be58371565e90270945e8ea4e8b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class ChoiceUI : MonoBehaviour
{
public Choice choice;
public TMP_Text title;
public TMP_Text description;
public GameObject selected;
public Image icon;
public GameObject unlocked;
public GameObject locked;
private bool isunlocked;
public bool IsUnlocked => isunlocked;
public void SetChoice(Choice _choice)
{
if (!_choice.requiresUnlocked)
{
isunlocked = true;
}
else
{
isunlocked = PerkManager.instance.UnlockedEquippables.Contains(_choice.requiresUnlocked);
}
unlocked.SetActive(isunlocked);
locked.SetActive(!isunlocked);
choice = _choice;
title.text = _choice.name;
description.text = _choice.tooltip;
icon.sprite = _choice.icon;
SetHighlighted(_highlighted: false);
}
public void SetHighlighted(bool _highlighted)
{
selected.SetActive(_highlighted);
}
}
|