public async Task noisy() { if (last != null) { last.SetActive(false); } GroupAnimation ga = s4.GetComponent <GroupAnimation>(); SoundPlayer.Play("gallery"); await ga.Reload(ga.path); s4.SetActive(true); last = s4; await Task.Run(() => { while (ga.playTime < 3) { Thread.Sleep(50); } }); ga = s5.GetComponent <GroupAnimation>(); SoundPlayer.Play("gavel"); await ga.Reload(ga.path); s5.SetActive(true); s4.SetActive(false); await Task.Run(() => { while (ga.playTime < 1) { Thread.Sleep(50); } }); s5.SetActive(false); }
public async void Should_ThrowException_PauseAsync() { var id = "id"; var animation = new GroupAnimation(id, _jsRuntime.Object); await Assert.ThrowsAnyAsync <NotSupportedException>(async() => await animation.PauseAsync()); _jsRuntime.VerifyNoOtherCalls(); }
public async void Should_SetOptionsAsync() { var id = "id"; var animation = new GroupAnimation(id, _jsRuntime.Object); var options = new GroupAnimationOptions(); await animation.SetOptionsAsync(options); _jsRuntime.Verify(runtime => runtime.InvokeVoidAsync(Constants.JsConstants.Methods.Animation.SetOptions.ToAnimationNamespace(), id, options), Times.Once); _jsRuntime.VerifyNoOtherCalls(); }
public async Task p3(string action, int loopcount = 0) { GroupAnimation ga = s3.transform.Find("p3").GetComponent <GroupAnimation>(); await ga.Reload("p3\\" + action, loopcount == 1); if (last != null && last != s3) { last.SetActive(false); } s3.SetActive(true); last = s3; await Task.Run(() => { while (ga.playTime < loopcount) { Thread.Sleep(50); } }); if (loopcount == 1) { await Delay(500); } }