2026-06-19 UI, UI로직
This commit is contained in:
42
Assets/My project/maze Scripts/Ui/MazeUIManager.cs
Normal file
42
Assets/My project/maze Scripts/Ui/MazeUIManager.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class MazeUIManager : MonoBehaviour
|
||||
{
|
||||
[Header("Result UI")]
|
||||
[SerializeField] private GameObject rewardPanel;
|
||||
[SerializeField] private TextMeshProUGUI rewardText;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
HideReward();
|
||||
}
|
||||
|
||||
public void ShowSuccess()
|
||||
{
|
||||
ShowResult("SUCCESS!", Color.green);
|
||||
}
|
||||
|
||||
public void ShowFail()
|
||||
{
|
||||
ShowResult("FAIL!", Color.red);
|
||||
}
|
||||
|
||||
private void ShowResult(string message, Color color)
|
||||
{
|
||||
if (rewardPanel != null)
|
||||
rewardPanel.SetActive(true);
|
||||
|
||||
if (rewardText != null)
|
||||
{
|
||||
rewardText.text = message;
|
||||
rewardText.color = color;
|
||||
}
|
||||
}
|
||||
|
||||
public void HideReward()
|
||||
{
|
||||
if (rewardPanel != null)
|
||||
rewardPanel.SetActive(false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user