Handbuch Scroll-Listen entfernt. Handbuch offen und tabs eingefügt. Upgrades eingefügt. "Garage" eingefügt. Anbindung eines echten Gameplaymanager möglich (theoretisch)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
namespace DepthsOfGreed.HandbookUI
|
||||
{
|
||||
public sealed class GeneralFeedbackController : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private RectTransform panel;
|
||||
[SerializeField] private TMP_Text message;
|
||||
private bool error;
|
||||
private float until;
|
||||
public void Initialize(RectTransform book, TMP_FontAsset font) { if (font) message.font = font; panel.gameObject.SetActive(false); }
|
||||
public void ShowControls(string text) { error = false; until = 0; message.text = text; panel.gameObject.SetActive(true); }
|
||||
public void ShowError(string text, bool bookOpen) { error = true; until = Time.unscaledTime + 3; message.text = text; panel.gameObject.SetActive(true); }
|
||||
public void HideControls() { if (!error) panel.gameObject.SetActive(false); }
|
||||
private void Update() { if (error && Time.unscaledTime > until) { panel.gameObject.SetActive(false); error = false; } }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user