Coroutine/Coroutine/WaitSeconds.cs
2019-11-20 11:30:28 +01:00

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();
}
}
}