Provides a module for handling each sequence separately while executing UniTask in parallel.
var result = await ConcurrentUniTaskHandler.Create(
// Effect
ProcessTask.Create(
waitTask: WaitEffectRequestAsync,
onPassedTask: async ct =>
{
await PlayEffectAsync(ct);
return true;
}),
// Close
ProcessTask.Create(
waitTask: WaitCloseRequestAsync,
onPassedTask: async ct =>
{
await CloseAsync(ct);
return false;
}),
// NextScene
ProcessTask.Create(
waitTask: WaitMoveNextSceneRequestAsync,
onPassedTask: async ct =>
{
await LoadNextSceneAsync(ct);
return false;
}),
)
.LoopProcessFirstCompletedTaskAsync(
checkNeedLoop: result => result,
cancellationToken: cancellationToken
);
- Open the Package Manager
- Press [+▼] button and click Add package from git URL...
- Enter the following:
openupm add com.tanitaka-tech.concurrent-unitask-handler