Skip to content

Commit

Permalink
Refactor CoroutineBase
Browse files Browse the repository at this point in the history
Move constructor to before methods
  • Loading branch information
Inspiaaa committed Sep 10, 2024
1 parent 323186f commit 6f89bbc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions addons/HCoroutines/src/CoroutineBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ public class CoroutineBase
/// </summary>
public event Action Stopped;

public CoroutineBase(CoProcessMode processMode, CoRunMode runMode)
{
this.ProcessMode = processMode;
this.RunMode = runMode;
}

public void StartCoroutine(CoroutineBase coroutine)
{
if (!IsAlive)
Expand All @@ -58,12 +64,6 @@ public void StartCoroutine(CoroutineBase coroutine)
AddChild(coroutine);
coroutine.Init();
}

public CoroutineBase(CoProcessMode processMode, CoRunMode runMode)
{
this.ProcessMode = processMode;
this.RunMode = runMode;
}

/// <summary>
/// Initializes the coroutine once it has been added to the active coroutine hierarchy.
Expand Down

0 comments on commit 6f89bbc

Please sign in to comment.