mirror of
https://github.com/Ellpeck/Coroutine.git
synced 2024-06-15 18:34:30 +02:00
26 lines
533 B
C#
26 lines
533 B
C#
using System;
|
|
|
|
namespace Coroutine {
|
|
public struct WaitSeconds : IWait {
|
|
|
|
private double seconds;
|
|
|
|
public WaitSeconds(double seconds) {
|
|
this.seconds = seconds;
|
|
}
|
|
|
|
public WaitType GetWaitType() {
|
|
return WaitType.Tick;
|
|
}
|
|
|
|
public bool Tick(double deltaSeconds) {
|
|
this.seconds -= deltaSeconds;
|
|
return this.seconds <= 0;
|
|
}
|
|
|
|
public bool OnEvent(Event evt) {
|
|
throw new NotSupportedException();
|
|
}
|
|
|
|
}
|
|
} |