From 349a5427fdc9236a36f7ef6c108e6efa70ba3ec0 Mon Sep 17 00:00:00 2001 From: AnnulusGames Date: Tue, 16 Jan 2024 16:08:27 +0900 Subject: [PATCH] Add: scheduler test --- .../Assets/LitMotion/Tests/Runtime/SchedulerTest.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/LitMotion/Assets/LitMotion/Tests/Runtime/SchedulerTest.cs b/src/LitMotion/Assets/LitMotion/Tests/Runtime/SchedulerTest.cs index acd7a102..ee47477a 100644 --- a/src/LitMotion/Assets/LitMotion/Tests/Runtime/SchedulerTest.cs +++ b/src/LitMotion/Assets/LitMotion/Tests/Runtime/SchedulerTest.cs @@ -94,6 +94,18 @@ public IEnumerator Test_Scheduler_Update() .ToYieldInteraction(); } + [UnityTest] + public IEnumerator Test_Scheduler_Update_WithHalfTimeScale() + { + Time.timeScale = 0.5f; + var t = Time.unscaledTimeAsDouble; + yield return LMotion.Create(0f, 10f, Duration) + .WithScheduler(MotionScheduler.Update) + .RunWithoutBinding() + .ToYieldInteraction(); + Assert.That(Time.unscaledTimeAsDouble - t, Is.GreaterThan(Duration * 2f)); + } + [UnityTest] public IEnumerator Test_Scheduler_Update_IgnoreTimeScale() {