21 lines
591 B
C#
21 lines
591 B
C#
// Alex 2025 06 02 DisplayCharacterHeight.cs
|
|
|
|
using UnityEngine;
|
|
using Unity.FPS.Gameplay;
|
|
using TMPro;
|
|
// using StarterAssets; // <- ajoute ceci si tu utilises StarterAssets
|
|
|
|
public class DisplayCharacterHeight : MonoBehaviour
|
|
{
|
|
// public Transform headTransform;
|
|
public TextMeshProUGUI heightText; // le champ TMP dans l'UI
|
|
public PlayerCharacterController PlayerController;
|
|
|
|
void Update()
|
|
{
|
|
float height = PlayerController.CurrentCharacterHeight;
|
|
heightText.text = $"({height:F2}m)";
|
|
// Debug.Log("DisplayCharacterHeight.cs, Character height : " + height);
|
|
}
|
|
}
|