Improved Timer QOL

Made it start on the player first moving and show on the game HUD.
This commit is contained in:
Pasha Bibko
2025-04-29 21:05:23 +01:00
parent f4d15f33e7
commit b86c9f7a14
4 changed files with 108 additions and 4 deletions

View File

@@ -36,6 +36,16 @@ public partial class PlayerMovement : MonoBehaviour
// Calculates the movement direction
m_MoveDir = (m_Orientation.forward * m_Input.y) + (m_Orientation.right * m_Input.x);
if (m_MoveDir != Vector3.zero && m_StartTime == 0.0f)
{
m_StartTime = Time.time;
}
if (m_StartTime != 0.0f)
{
m_TimeText.text = (Time.time - m_StartTime).ToString("0.00") + " s";
}
//
if (m_OnSlope)
{