Added archive system. Added ml debug menu and related stuff

This commit is contained in:
Marcel Baumgartner
2023-06-16 16:58:58 +02:00
parent 2ca41ff18f
commit 46a88d4638
25 changed files with 1868 additions and 14 deletions

View File

@@ -112,4 +112,22 @@ public class EventSystem
return Task.CompletedTask;
}
public Task<T> WaitForEvent<T>(string id, object handle, Func<T, bool> filter)
{
var taskCompletionSource = new TaskCompletionSource<T>();
Func<T, Task> action = async data =>
{
if (filter.Invoke(data))
{
taskCompletionSource.SetResult(data);
await Off(id, handle);
}
};
On<T>(id, handle, action);
return taskCompletionSource.Task;
}
}