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

35 lines
729 B
C#

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;
}
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;
}
}
}