1
This commit is contained in:
@@ -11,8 +11,8 @@ namespace BITKit
|
||||
public event Action<float> onProgess;
|
||||
public event Action<string> onSetTotalTime;
|
||||
public event Action<string> onTime;
|
||||
float totalTime => (float)list.Count / frameRate;
|
||||
protected override void OnUpdate()
|
||||
public float totalTime => (float)list.Count / frameRate;
|
||||
protected override async void OnUpdate()
|
||||
{
|
||||
if (list.Count > 0)
|
||||
{
|
||||
@@ -20,6 +20,7 @@ namespace BITKit
|
||||
if (state is PlayerState.Playing)
|
||||
index = Math.Clamp(++index, 0, list.Count + 32);
|
||||
|
||||
await BITApp.SwitchToMainThread();
|
||||
if (index > list.Count)
|
||||
{
|
||||
if (index - list.Count > frameRate / 2)
|
||||
@@ -27,6 +28,8 @@ namespace BITKit
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (BITApp.CancellationToken.IsCancellationRequested) return;
|
||||
output?.Invoke(list[index]);
|
||||
onProgess?.Invoke(progess);
|
||||
onTime?.Invoke(GetTime(totalTime * progess));
|
||||
@@ -63,5 +66,6 @@ namespace BITKit
|
||||
{
|
||||
return new DateTime().AddSeconds(sec).ToString(timeFormat);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user