-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Create an enum for different run modes that determine whether a coroutine can be paused and when it runs. - Refactor the CoroutineBase code by adding a new Init() method which internally calls OnEnter(). This allows the virtual OnEnter() method to be empty, so that subclasses need not call the base class implementation.
- Loading branch information
Showing
3 changed files
with
49 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace HCoroutines; | ||
|
||
/// <summary> | ||
/// The RunMode determines when the coroutine is run and whether it can be paused. | ||
/// </summary> | ||
public enum CoRunMode { | ||
/// <summary> | ||
/// The RunMode is inherited from the parent coroutine. If there is no parent, Pausable is used. | ||
/// </summary> | ||
Inherit, | ||
|
||
/// <summary> | ||
/// The coroutine is paused when the game is paused. | ||
/// </summary> | ||
Pausable, | ||
|
||
/// <summary> | ||
/// The coroutine only runs when the game is paused. | ||
/// </summary> | ||
WhenPaused, | ||
|
||
/// <summary> | ||
/// The coroutine always runs, regardless of whether the game is paused is or not. | ||
/// </summary> | ||
Always | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters