42 lines
1.5 KiB
C#
42 lines
1.5 KiB
C#
using OnlyScove.Scripts;
|
|
using UnityEngine;
|
|
using TMPro;
|
|
|
|
namespace UI
|
|
{
|
|
public class MyUIDisplay : MonoBehaviour
|
|
{
|
|
public PlayerDebugProvider playerDebugProvider;
|
|
|
|
[Header("Text Fields")]
|
|
public TextMeshProUGUI stateText;
|
|
public TextMeshProUGUI groundedStatusText;
|
|
public TextMeshProUGUI horizontalSpeedText;
|
|
public TextMeshProUGUI verticaSpeedText;
|
|
public TextMeshProUGUI moveInputText;
|
|
public TextMeshProUGUI isSprintingText;
|
|
|
|
private void Update()
|
|
{
|
|
if (playerDebugProvider == null) return;
|
|
|
|
if (stateText != null)
|
|
stateText.text = "State: " + playerDebugProvider.CurrentState;
|
|
|
|
if (groundedStatusText != null)
|
|
groundedStatusText.text = "Grounded: " + playerDebugProvider.GroundedStatus;
|
|
|
|
if (horizontalSpeedText != null)
|
|
horizontalSpeedText.text = "Speed (H): " + playerDebugProvider.HorizontalSpeed.ToString("F2") + " m/s";
|
|
|
|
if (verticaSpeedText != null)
|
|
verticaSpeedText.text = "Speed (V): " + playerDebugProvider.VerticalSpeed.ToString("F2") + " m/s";
|
|
|
|
if (moveInputText != null)
|
|
moveInputText.text = "Input: " + playerDebugProvider.MoveInput.ToString();
|
|
|
|
if (isSprintingText != null)
|
|
isSprintingText.text = "Sprinting: " + (playerDebugProvider.IsSprinting ? "YES" : "NO");
|
|
}
|
|
}
|
|
} |