37 lines
893 B
C#
37 lines
893 B
C#
using TMPro;
|
||
using UnityEngine;
|
||
using VMdemo.Simulation;
|
||
|
||
namespace VMdemo.UI
|
||
{
|
||
public class SimulationProcessHeaderView : MonoBehaviour
|
||
{
|
||
[SerializeField] private TMP_Text currentStepText;
|
||
[SerializeField] private TMP_Text currentEventText;
|
||
|
||
public void RenderStep(SimulationState state)
|
||
{
|
||
if (state == null)
|
||
{
|
||
SetText(currentStepText, "步骤:N/A");
|
||
return;
|
||
}
|
||
|
||
SetText(currentStepText, $"步骤:{TranslationStepDisplay.ToChinese(state.CurrentStep)}");
|
||
}
|
||
|
||
public void SetEvent(string message)
|
||
{
|
||
SetText(currentEventText, message);
|
||
}
|
||
|
||
private static void SetText(TMP_Text target, string text)
|
||
{
|
||
if (target != null)
|
||
{
|
||
target.text = text;
|
||
}
|
||
}
|
||
}
|
||
}
|