Finished converting to new UI.

This commit is contained in:
Max 2025-02-27 15:52:40 +01:00
parent f70f89324b
commit 105055b307
37 changed files with 24044 additions and 1227 deletions

View file

@ -0,0 +1,46 @@
using System;
using UnityEngine;
using UnityEngine.UIElements;
namespace UI
{
public class ChestPopUpController : MonoBehaviour
{
public event Action BlackDieSelected;
public event Action KeySelected;
public event Action ArmorAndDiamondSelected;
private Button _blackDie;
private Button _key;
private Button _armorAndDiamond;
private void OnEnable()
{
VisualElement root = GetComponent<UIDocument>().rootVisualElement;
_blackDie = root.Q<Button>("BlackDie");
_blackDie.clicked += () => BlackDieSelected?.Invoke();
_key = root.Q<Button>("Key");
_key.clicked += () => KeySelected?.Invoke();
_armorAndDiamond = root.Q<Button>("ArmorAndDiamond");
_armorAndDiamond.clicked += () => ArmorAndDiamondSelected?.Invoke();
}
public void DisableBlackDie()
{
_blackDie.SetEnabled(false);
}
public void DisableKey()
{
_key.SetEnabled(false);
}
public void DisableArmorAndDiamond()
{
_armorAndDiamond.SetEnabled(false);
}
}
}