mirror of
https://github.com/Ellpeck/Coroutine.git
synced 2024-11-21 21:33:29 +01:00
update the documentation (which has been outdated for a while apparently, oops)
This commit is contained in:
parent
2453232fd2
commit
a77c9874e7
1 changed files with 4 additions and 4 deletions
|
@ -31,11 +31,11 @@ To create a coroutine, simply create a method with the return type `IEnumerator<
|
|||
```cs
|
||||
private static IEnumerator<Wait> WaitSeconds() {
|
||||
Console.WriteLine("First thing " + DateTime.Now);
|
||||
yield return new WaitSeconds(1);
|
||||
yield return new Wait(1);
|
||||
Console.WriteLine("After 1 second " + DateTime.Now);
|
||||
yield return new WaitSeconds(5);
|
||||
yield return new Wait(5);
|
||||
Console.WriteLine("After 5 seconds " + DateTime.Now);
|
||||
yield return new WaitSeconds(10);
|
||||
yield return new Wait(10);
|
||||
Console.WriteLine("After 10 seconds " + DateTime.Now);
|
||||
}
|
||||
```
|
||||
|
@ -55,7 +55,7 @@ private static readonly Event TestEvent = new Event();
|
|||
Waiting for an event in a coroutine works as follows:
|
||||
```cs
|
||||
private static IEnumerator<Wait> WaitForTestEvent() {
|
||||
yield return new WaitEvent(TestEvent);
|
||||
yield return new Wait(TestEvent);
|
||||
Console.WriteLine("Test event received");
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue