Над физикой работаю. Добаил UI минимальное
This commit is contained in:
1 parent
48753f65fb
commit
f9ec01d1c8
912 files changed
+204440
-3555
No files matched your search
@@ -0,0 +1,41 @@
|
||||
using UnityEngine;
|
||||
using TMPro;
|
||||
using UnityEngine; // Обязательно подключаем библиотеку TextMeshPro
|
||||
|
||||
public class UIManager : MonoBehaviour
|
||||
{
|
||||
[Header("UI Elements")]
|
||||
[SerializeField] private TextMeshProUGUI interactText; // Ссылка на наш текст
|
||||
[SerializeField] private TextMeshProUGUI speedText;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
// При старте игры подсказка должна быть скрыта
|
||||
HidePrompt();
|
||||
ToggleDashboard(false);
|
||||
}
|
||||
|
||||
public void ToggleDashboard(bool isActive)
|
||||
{
|
||||
if (speedText != null)
|
||||
speedText.gameObject.SetActive(isActive);
|
||||
}
|
||||
|
||||
public void UpdateSpeed(float currentSpeed)
|
||||
{
|
||||
if (speedText != null)
|
||||
speedText.text = $"{currentSpeed:F0} км/ч";
|
||||
}
|
||||
|
||||
public void ShowPrompt(string message)
|
||||
{
|
||||
interactText.text = message;
|
||||
|
||||
interactText.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
public void HidePrompt()
|
||||
{
|
||||
interactText.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2942b1ecd944412c924c1cb70b3a2902
|
||||
timeCreated: 1789844366
|
||||
Reference in new issue
Block a user