rj-action-library/Runtime/Time/Duration/Duration.cs

35 lines
729 B
C#
Raw Normal View History

2025-06-12 09:03:02 +00:00
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using System;
using Godot;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class Duration:Resource
{
[Export]
public TimeLine timeLine;
public virtual float GetDurationInSeconds()
{
return 0;
}
2025-07-25 08:13:35 +00:00
public static string GetTimerLabel( float seconds )
{
var secondsAmount = seconds % 60;
var minutesAmount = ( seconds - secondsAmount ) / 60f;
var secondsLabel = Text.WithLeadingZeros( Mathf.CeilToInt( secondsAmount ) );
var minutesLabel = Text.WithLeadingZeros( Mathf.CeilToInt( minutesAmount ) );
return minutesLabel + ":" + secondsLabel;
}
2025-06-12 09:03:02 +00:00
}
}