mirror of
https://github.com/Ellpeck/Coroutine.git
synced 2024-11-24 14:18:34 +01:00
some readme tweaks
This commit is contained in:
parent
a7ee8cdac0
commit
f1cb33d904
1 changed files with 5 additions and 2 deletions
|
@ -15,7 +15,7 @@ Additionally, Coroutine provides the following features:
|
|||
|
||||
# How to Use
|
||||
## Setting up the CoroutineHandler
|
||||
The `CoroutineHandler` is the place where coroutines get executed. For this to occur, the `Tick` method needs to be called continuously. This can either be done in your application's existing update loop or as follows:
|
||||
The `CoroutineHandler` is the place where coroutines get executed. For this to occur, the `Tick` method needs to be called continuously. The `Tick` method takes a single parameter which represents the amount of seconds since the last time it was called. It can either be called in your application's existing update loop or as follows.
|
||||
```cs
|
||||
var lastTime = DateTime.Now;
|
||||
while (true) {
|
||||
|
@ -63,4 +63,7 @@ private static IEnumerator<Wait> WaitForTestEvent() {
|
|||
To actually cause the event to be raised, causing all currently waiting coroutines to be continued, simply call `RaiseEvent`:
|
||||
```cs
|
||||
CoroutineHandler.RaiseEvent(TestEvent);
|
||||
```
|
||||
```
|
||||
|
||||
## Additional Examples
|
||||
For additional examples, take a look at the [Example class](https://github.com/Ellpeck/Coroutine/blob/master/Test/Example.cs).
|
Loading…
Reference in a new issue