Stoppable multi-unload in raid

This commit is contained in:
Tyfon
2024-06-21 11:49:40 -07:00
parent 936c3fad54
commit 26ba6810ad
3 changed files with 53 additions and 5 deletions

View File

@@ -26,9 +26,20 @@ namespace UIFixes
return totalTask.Task;
}
public void Cancel()
{
totalTask.TrySetCanceled();
}
public void Update()
{
if (!currentTask.IsCompleted)
if (currentTask.IsCanceled)
{
Complete();
return;
}
if (totalTask.Task.IsCompleted || !currentTask.IsCompleted)
{
return;
}
@@ -39,10 +50,15 @@ namespace UIFixes
}
else
{
totalTask.Complete();
func = null;
Destroy(this);
Complete();
}
}
private void Complete()
{
totalTask.Complete();
func = null;
Destroy(this);
}
}
}