Commit 1
This commit is contained in:
42
Assets/Scripts/UI/MyUIDisplay.cs
Normal file
42
Assets/Scripts/UI/MyUIDisplay.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/UI/MyUIDisplay.cs.meta
Normal file
3
Assets/Scripts/UI/MyUIDisplay.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cd13c5c96000414397dd7d41a73edd62
|
||||
timeCreated: 1773383951
|
||||
Reference in New Issue
Block a user