Skip to content

Commit

Permalink
Fix bug in ParallelCoroutine
Browse files Browse the repository at this point in the history
Solve issue of ParallelCoroutine not terminating when no coroutines are passed (empty array)
  • Loading branch information
Inspiaaa committed Aug 30, 2023
1 parent ee6cf3f commit d0bdb42
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Coroutines/ParallelCoroutine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ public ParallelCoroutine(params CoroutineBase[] coroutines)

public override void OnEnter()
{
if (coroutines.Length == 0)
{
Kill();
return;
}

foreach (CoroutineBase coroutine in coroutines)
{
StartCoroutine(coroutine);
Expand Down

0 comments on commit d0bdb42

Please sign in to comment.