public async Task Play(Animation ani, float duration) { this.duration = duration; elapsedTime = TimeSpan.Zero; this.triggerKeys = null; this.animation = ani; await this.semaphore.WaitAsync(); this.animation = null; }
public async Task<Keys> PlayUntil(Animation ani, Keys[] keys) { this.duration = 0; this.triggerKeys = keys; this.onRelease = true; this.animation = ani; await this.semaphore.WaitAsync(); this.animation = null; return currentKey; }