From 765c7fb89cf01bc8beb0209b3cc7a672030958b2 Mon Sep 17 00:00:00 2001
From: Jeremy Pritts <49847914+ds5678@users.noreply.github.com>
Date: Sun, 20 Sep 2026 02:12:17 -0700
Subject: [PATCH] Update templates and sample code to better support pausing
(#3355)
Samples and templates: gameplay follows the time factor, camera and UI don't
Timers, cooldowns, speeds and animation now use UpdateTime.WarpElapsed, so they
stop when Factor is 0, like physics and particles already did. Camera, input and
UI keep UpdateTime.Elapsed.
The animation scripts also read UpdateTime instead of DrawTime, which is the
clock the engine's own animation system uses.
Removes the unused BasicCameraController from ThirdPersonPlatformer.
---
.../JumpyJet/JumpyJet.Game/CharacterScript.cs | 2 +-
.../JumpyJet/JumpyJet.Game/PipesScript.cs | 2 +-
.../Background/BackgroundScript.cs | 2 +-
.../AnimatedModel.Game/RotateEntity.cs | 2 +-
.../SpriteStudioDemo.Game/PlayerScript.cs | 2 +-
.../TouchInputs.Game/TouchInputsScript.cs | 4 +-
.../ParticlesSample.Game/PrefabInstance.cs | 2 +-
.../ParticlesSample.Game/RotateEntity.cs | 2 +-
.../Player/AnimationController.cs | 2 +-
.../Player/WeaponScript.cs | 4 +-
.../Trigger/TriggerScript.cs | 2 +-
.../Gameplay/CoinRotation.cs | 2 +-
.../Platformer2D.Game/PlayerController.cs | 2 +-
.../BasicCameraController.cs | 188 ------------------
.../Player/AnimationController.cs | 14 +-
.../Player/PlayerController.cs | 1 -
.../TopDownRPG/TopDownRPG.Game/Core/Utils.cs | 2 +-
.../TopDownRPG.Game/Gameplay/CoinScript.cs | 2 +-
.../TopDownRPG.Game/Gameplay/CrateScript.cs | 2 +-
.../Gameplay/LootCoinScript.cs | 2 +-
.../Player/AnimationController.cs | 7 +-
.../Player/PlayerController.cs | 2 +-
.../CSharpBeginner.Game/Code/DeltaTimeDemo.cs | 2 +-
.../Code/KeyboardInputDemo.cs | 2 +-
.../CSharpBeginner.Game/Code/LerpDemo.cs | 2 +-
.../Code/MouseInputDemo.cs | 2 +-
.../Code/RemoveEntitiesDemo.cs | 2 +-
.../Code/VirtualButtonsDemo.cs | 2 +-
.../11_Navigation/NavigateCharacter.cs | 2 +-
.../Utils/OmniDirectionMovement.cs | 2 +-
.../UIParticles.Game/SplashScript.cs | 6 +-
.../Scripts/Animation/AnimationBlend.cs | 5 +-
.../Assets/Scripts/Events/EventBroadcaster.cs | 2 +-
.../Scripts/Physics/PlayerController.cs | 4 +-
.../Assets/Scripts/Prefabs/PrefabInstance.cs | 4 +-
35 files changed, 47 insertions(+), 240 deletions(-)
delete mode 100644 samples/Templates/ThirdPersonPlatformer/ThirdPersonPlatformer/ThirdPersonPlatformer.Game/BasicCameraController.cs
diff --git a/samples/Games/JumpyJet/JumpyJet.Game/CharacterScript.cs b/samples/Games/JumpyJet/JumpyJet.Game/CharacterScript.cs
index 9a9304322..b34951135 100644
--- a/samples/Games/JumpyJet/JumpyJet.Game/CharacterScript.cs
+++ b/samples/Games/JumpyJet/JumpyJet.Game/CharacterScript.cs
@@ -124,7 +124,7 @@ namespace JumpyJet
if (!isRunning)
continue;
- var elapsedTime = (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ var elapsedTime = (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
// apply impulse on the touch/space
if (Input.IsKeyPressed(Keys.Space) || UserTappedScreen())
diff --git a/samples/Games/JumpyJet/JumpyJet.Game/PipesScript.cs b/samples/Games/JumpyJet/JumpyJet.Game/PipesScript.cs
index 2371ba173..22467489a 100644
--- a/samples/Games/JumpyJet/JumpyJet.Game/PipesScript.cs
+++ b/samples/Games/JumpyJet/JumpyJet.Game/PipesScript.cs
@@ -66,7 +66,7 @@ namespace JumpyJet
if (!isScrolling)
return;
- var elapsedTime = (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ var elapsedTime = (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
for (int i = 0; i < pipeSets.Count; i++)
{
diff --git a/samples/Games/SpaceEscape/SpaceEscape.Game/Background/BackgroundScript.cs b/samples/Games/SpaceEscape/SpaceEscape.Game/Background/BackgroundScript.cs
index 9f1c6e9b6..96842d804 100644
--- a/samples/Games/SpaceEscape/SpaceEscape.Game/Background/BackgroundScript.cs
+++ b/samples/Games/SpaceEscape/SpaceEscape.Game/Background/BackgroundScript.cs
@@ -78,7 +78,7 @@ namespace SpaceEscape.Background
if (!isScrolling)
return;
- var elapsedTime = (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ var elapsedTime = (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
// Check if needed to remove the first block
var firstBlock = levelBlocks[0];
diff --git a/samples/Graphics/AnimatedModel/AnimatedModel.Game/RotateEntity.cs b/samples/Graphics/AnimatedModel/AnimatedModel.Game/RotateEntity.cs
index 58f5143a5..2562d1ebe 100644
--- a/samples/Graphics/AnimatedModel/AnimatedModel.Game/RotateEntity.cs
+++ b/samples/Graphics/AnimatedModel/AnimatedModel.Game/RotateEntity.cs
@@ -24,7 +24,7 @@ namespace AnimatedModel
rotationSpeed = 200f * Input.PointerEvents.Sum(x => x.DeltaPosition.X);
rotationSpeed *= 0.93f;
- var elapsedTime = (float) Game.UpdateTime.Elapsed.TotalSeconds;
+ var elapsedTime = (float) Game.UpdateTime.WarpElapsed.TotalSeconds;
Entity.Transform.Rotation *= Quaternion.RotationY(rotationSpeed * elapsedTime);
}
}
diff --git a/samples/Graphics/SpriteStudioDemo/SpriteStudioDemo.Game/PlayerScript.cs b/samples/Graphics/SpriteStudioDemo/SpriteStudioDemo.Game/PlayerScript.cs
index 0322c1b09..792ba69a9 100644
--- a/samples/Graphics/SpriteStudioDemo/SpriteStudioDemo.Game/PlayerScript.cs
+++ b/samples/Graphics/SpriteStudioDemo/SpriteStudioDemo.Game/PlayerScript.cs
@@ -103,7 +103,7 @@ namespace SpriteStudioDemo
if (inputState == InputState.RunLeft || inputState == InputState.RunRight)
{
// Update Agent's position
- var dt = (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ var dt = (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
Entity.Transform.Position.X += ((inputState == InputState.RunRight) ? AgentMoveDistance : -AgentMoveDistance) * dt;
diff --git a/samples/Input/TouchInputs/TouchInputs.Game/TouchInputsScript.cs b/samples/Input/TouchInputs/TouchInputs.Game/TouchInputsScript.cs
index 318aa1ead..3e83a6517 100644
--- a/samples/Input/TouchInputs/TouchInputs.Game/TouchInputsScript.cs
+++ b/samples/Input/TouchInputs/TouchInputs.Game/TouchInputsScript.cs
@@ -81,7 +81,7 @@ namespace TouchInputs
public override void Update()
{
- var currentTime = Game.DrawTime.Total;
+ var currentTime = Game.UpdateTime.Total;
keyDown = "";
keyEvents = "";
@@ -248,7 +248,7 @@ namespace TouchInputs
{
var screenSize = spriteBatch.VirtualResolution.Value;
var position = tuple.Item1;
- var duration = Game.DrawTime.Total - tuple.Item2;
+ var duration = Game.UpdateTime.Total - tuple.Item2;
var scale = (float)(0.2f * (1f - duration.TotalSeconds / displayPointerDuration.TotalSeconds));
var pointerScreenPosition = new Vector2(position.X * screenSize.X, position.Y * screenSize.Y);
diff --git a/samples/Particles/ParticlesSample/ParticlesSample.Game/PrefabInstance.cs b/samples/Particles/ParticlesSample/ParticlesSample.Game/PrefabInstance.cs
index fae389fba..8737391a1 100644
--- a/samples/Particles/ParticlesSample/ParticlesSample.Game/PrefabInstance.cs
+++ b/samples/Particles/ParticlesSample/ParticlesSample.Game/PrefabInstance.cs
@@ -115,7 +115,7 @@ namespace ParticlesSample
while (secondsCountdown > 0f)
{
await Script.NextFrame();
- secondsCountdown -= (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ secondsCountdown -= (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
}
// Remove
diff --git a/samples/Particles/ParticlesSample/ParticlesSample.Game/RotateEntity.cs b/samples/Particles/ParticlesSample/ParticlesSample.Game/RotateEntity.cs
index fe460ef02..39d875b8f 100644
--- a/samples/Particles/ParticlesSample/ParticlesSample.Game/RotateEntity.cs
+++ b/samples/Particles/ParticlesSample/ParticlesSample.Game/RotateEntity.cs
@@ -24,7 +24,7 @@ namespace ParticlesSample
rotationSpeed = 200f * Input.PointerEvents.Sum(x => x.DeltaPosition.X);
rotationSpeed *= 0.93f;
- var elapsedTime = (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ var elapsedTime = (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
Entity.Transform.Rotation *= Quaternion.RotationY(rotationSpeed * elapsedTime);
}
}
diff --git a/samples/Templates/FirstPersonShooter/FirstPersonShooter/FirstPersonShooter.Game/Player/AnimationController.cs b/samples/Templates/FirstPersonShooter/FirstPersonShooter/FirstPersonShooter.Game/Player/AnimationController.cs
index b610bf064..66d320e05 100644
--- a/samples/Templates/FirstPersonShooter/FirstPersonShooter/FirstPersonShooter.Game/Player/AnimationController.cs
+++ b/samples/Templates/FirstPersonShooter/FirstPersonShooter/FirstPersonShooter.Game/Player/AnimationController.cs
@@ -123,7 +123,7 @@ namespace FirstPersonShooter.Player
// Update current animation
var currentTicks = TimeSpan.FromTicks((long)(currentTime * currentClip.Duration.Ticks));
- var updatedTicks = currentTicks.Ticks + (long)(Game.DrawTime.Elapsed.Ticks * TimeFactor);
+ var updatedTicks = currentTicks.Ticks + (long)(Game.UpdateTime.WarpElapsed.Ticks * TimeFactor);
var currentClipFinished = (updatedTicks >= currentClip.Duration.Ticks);
diff --git a/samples/Templates/FirstPersonShooter/FirstPersonShooter/FirstPersonShooter.Game/Player/WeaponScript.cs b/samples/Templates/FirstPersonShooter/FirstPersonShooter/FirstPersonShooter.Game/Player/WeaponScript.cs
index 7b3b8e10e..f60dec6f9 100644
--- a/samples/Templates/FirstPersonShooter/FirstPersonShooter/FirstPersonShooter.Game/Player/WeaponScript.cs
+++ b/samples/Templates/FirstPersonShooter/FirstPersonShooter/FirstPersonShooter.Game/Player/WeaponScript.cs
@@ -56,7 +56,7 @@ namespace FirstPersonShooter.Player
while (secondsCountdown > 0f)
{
await Script.NextFrame();
- secondsCountdown -= (float) Game.UpdateTime.Elapsed.TotalSeconds;
+ secondsCountdown -= (float) Game.UpdateTime.WarpElapsed.TotalSeconds;
}
remainingBullets = 9;
@@ -77,7 +77,7 @@ namespace FirstPersonShooter.Player
bool didReload;
reloadEvent.TryReceive(out didReload);
- cooldownRemaining = (cooldownRemaining > 0) ? (cooldownRemaining - (float)this.Game.UpdateTime.Elapsed.TotalSeconds) : 0f;
+ cooldownRemaining = (cooldownRemaining > 0) ? (cooldownRemaining - (float)this.Game.UpdateTime.WarpElapsed.TotalSeconds) : 0f;
if (cooldownRemaining > 0)
return; // Can't shoot yet
diff --git a/samples/Templates/FirstPersonShooter/FirstPersonShooter/FirstPersonShooter.Game/Trigger/TriggerScript.cs b/samples/Templates/FirstPersonShooter/FirstPersonShooter/FirstPersonShooter.Game/Trigger/TriggerScript.cs
index ee6bd968a..bbb66f8e3 100644
--- a/samples/Templates/FirstPersonShooter/FirstPersonShooter/FirstPersonShooter.Game/Trigger/TriggerScript.cs
+++ b/samples/Templates/FirstPersonShooter/FirstPersonShooter/FirstPersonShooter.Game/Trigger/TriggerScript.cs
@@ -59,7 +59,7 @@ namespace FirstPersonShooter
while (secondsCountdown > 0f)
{
await Script.NextFrame();
- secondsCountdown -= (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ secondsCountdown -= (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
}
// Remove
diff --git a/samples/Templates/Platformer2D/Platformer2D/Platformer2D.Game/Gameplay/CoinRotation.cs b/samples/Templates/Platformer2D/Platformer2D/Platformer2D.Game/Gameplay/CoinRotation.cs
index 4c61dd90e..e8c11a7af 100644
--- a/samples/Templates/Platformer2D/Platformer2D/Platformer2D.Game/Gameplay/CoinRotation.cs
+++ b/samples/Templates/Platformer2D/Platformer2D/Platformer2D.Game/Gameplay/CoinRotation.cs
@@ -19,7 +19,7 @@ public class CoinRotation : SyncScript
public override void Update()
{
- animationTimer += (float) Game.UpdateTime.Elapsed.TotalSeconds;
+ animationTimer += (float) Game.UpdateTime.WarpElapsed.TotalSeconds;
if (animationTimer >= animationInterval)
{
diff --git a/samples/Templates/Platformer2D/Platformer2D/Platformer2D.Game/PlayerController.cs b/samples/Templates/Platformer2D/Platformer2D/Platformer2D.Game/PlayerController.cs
index 273f1684e..d136ea48e 100644
--- a/samples/Templates/Platformer2D/Platformer2D/Platformer2D.Game/PlayerController.cs
+++ b/samples/Templates/Platformer2D/Platformer2D/Platformer2D.Game/PlayerController.cs
@@ -93,7 +93,7 @@ public class PlayerController : SyncScript
private void HandleAnimation(bool isMoving)
{
- animationTimer += (float) Game.UpdateTime.Elapsed.TotalSeconds;
+ animationTimer += (float) Game.UpdateTime.WarpElapsed.TotalSeconds;
if (CharacterComponent.IsGrounded && !isMoving)
{
diff --git a/samples/Templates/ThirdPersonPlatformer/ThirdPersonPlatformer/ThirdPersonPlatformer.Game/BasicCameraController.cs b/samples/Templates/ThirdPersonPlatformer/ThirdPersonPlatformer/ThirdPersonPlatformer.Game/BasicCameraController.cs
deleted file mode 100644
index d27a23eb4..000000000
--- a/samples/Templates/ThirdPersonPlatformer/ThirdPersonPlatformer/ThirdPersonPlatformer.Game/BasicCameraController.cs
+++ /dev/null
@@ -1,188 +0,0 @@
-// Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net) and Silicon Studio Corp. (https://www.siliconstudio.co.jp)
-// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.
-using System;
-using Stride.Core;
-using Stride.Core.Mathematics;
-using Stride.Engine;
-using Stride.Input;
-
-namespace ThirdPersonPlatformer
-{
- ///
- /// A script that allows to move and rotate an entity through keyboard, mouse and touch input to provide basic camera navigation.
- ///
- ///
- /// The entity can be moved using W, A, S, D, Q and E, arrow keys or dragging/scaling using multi-touch.
- /// Rotation is achieved using the Numpad, the mouse while holding the right mouse button, or dragging using single-touch.
- ///
- public class BasicCameraController : SyncScript
- {
- private const float MaximumPitch = MathUtil.PiOverTwo * 0.99f;
-
- private Vector3 upVector;
- private Vector3 translation;
- private float yaw;
- private float pitch;
-
- public Vector3 KeyboardMovementSpeed { get; set; } = new Vector3(5.0f);
-
- public Vector3 TouchMovementSpeed { get; set; } = new Vector3(40, 40, 20);
-
- public float SpeedFactor { get; set; } = 5.0f;
-
- public Vector2 KeyboardRotationSpeed { get; set; } = new Vector2(3.0f);
-
- public Vector2 MouseRotationSpeed { get; set; } = new Vector2(90.0f, 60.0f);
-
- public Vector2 TouchRotationSpeed { get; set; } = new Vector2(60.0f, 40.0f);
-
- public override void Start()
- {
- base.Start();
-
- // Default up-direction
- upVector = Vector3.UnitY;
-
- // Configure touch input
- if (!Platform.IsWindowsDesktop)
- {
- Input.Gestures.Add(new GestureConfigDrag());
- Input.Gestures.Add(new GestureConfigComposite());
- }
- }
-
- public override void Update()
- {
- ProcessInput();
- UpdateTransform();
- }
-
- private void ProcessInput()
- {
- translation = Vector3.Zero;
- yaw = 0;
- pitch = 0;
-
- // Move with keyboard
- if (Input.IsKeyDown(Keys.W) || Input.IsKeyDown(Keys.Up))
- {
- translation.Z = -KeyboardMovementSpeed.Z;
- }
- else if (Input.IsKeyDown(Keys.S) || Input.IsKeyDown(Keys.Down))
- {
- translation.Z = KeyboardMovementSpeed.Z;
- }
-
- if (Input.IsKeyDown(Keys.A) || Input.IsKeyDown(Keys.Left))
- {
- translation.X = -KeyboardMovementSpeed.X;
- }
- else if (Input.IsKeyDown(Keys.D) || Input.IsKeyDown(Keys.Right))
- {
- translation.X = KeyboardMovementSpeed.X;
- }
-
- if (Input.IsKeyDown(Keys.Q))
- {
- translation.Y = -KeyboardMovementSpeed.Y;
- }
- else if (Input.IsKeyDown(Keys.E))
- {
- translation.Y = KeyboardMovementSpeed.Y;
- }
-
- // Alternative translation speed
- if (Input.IsKeyDown(Keys.LeftShift) || Input.IsKeyDown(Keys.RightShift))
- {
- translation *= SpeedFactor;
- }
-
- // Rotate with keyboard
- if (Input.IsKeyDown(Keys.NumPad2))
- {
- pitch = KeyboardRotationSpeed.X;
- }
- else if (Input.IsKeyDown(Keys.NumPad8))
- {
- pitch = -KeyboardRotationSpeed.X;
- }
-
- if (Input.IsKeyDown(Keys.NumPad4))
- {
- yaw = KeyboardRotationSpeed.Y;
- }
- else if (Input.IsKeyDown(Keys.NumPad6))
- {
- yaw = -KeyboardRotationSpeed.Y;
- }
-
- // Rotate with mouse
- if (Input.IsMouseButtonDown(MouseButton.Right))
- {
- Input.LockMousePosition();
- Game.IsMouseVisible = false;
-
- yaw = -Input.MouseDelta.X * MouseRotationSpeed.X;
- pitch = -Input.MouseDelta.Y * MouseRotationSpeed.Y;
- }
- else
- {
- Input.UnlockMousePosition();
- Game.IsMouseVisible = true;
- }
-
- // Handle gestures
- foreach (var gestureEvent in Input.GestureEvents)
- {
- switch (gestureEvent.Type)
- {
- // Rotate by dragging
- case GestureType.Drag:
- var drag = (GestureEventDrag)gestureEvent;
- var dragDistance = drag.DeltaTranslation;
- yaw = -dragDistance.X * TouchRotationSpeed.X;
- pitch = -dragDistance.Y * TouchRotationSpeed.Y;
- break;
-
- // Move along z-axis by scaling and in xy-plane by multi-touch dragging
- case GestureType.Composite:
- var composite = (GestureEventComposite)gestureEvent;
- translation.X = -composite.DeltaTranslation.X * TouchMovementSpeed.X;
- translation.Y = -composite.DeltaTranslation.Y * TouchMovementSpeed.Y;
- translation.Z = -(float)Math.Log(composite.DeltaScale + 1) * TouchMovementSpeed.Z;
- break;
- }
- }
- }
-
- private void UpdateTransform()
- {
- var elapsedTime = (float)Game.UpdateTime.Elapsed.TotalSeconds;
-
- translation *= elapsedTime;
- yaw *= elapsedTime;
- pitch *= elapsedTime;
-
- // Get the local coordinate system
- var rotation = Matrix.RotationQuaternion(Entity.Transform.Rotation);
-
- // Enforce the global up-vector by adjusting the local x-axis
- var right = Vector3.Cross(rotation.Forward, upVector);
- var up = Vector3.Cross(right, rotation.Forward);
-
- // Stabilize
- right.Normalize();
- up.Normalize();
-
- // Adjust pitch. Prevent it from exceeding up and down facing. Stabilize edge cases.
- var currentPitch = MathUtil.PiOverTwo - (float)Math.Acos(Vector3.Dot(rotation.Forward, upVector));
- pitch = MathUtil.Clamp(currentPitch + pitch, -MaximumPitch, MaximumPitch) - currentPitch;
-
- // Move in local coordinates
- Entity.Transform.Position += Vector3.TransformCoordinate(translation, rotation);
-
- // Yaw around global up-vector, pitch and roll in local space
- Entity.Transform.Rotation *= Quaternion.RotationAxis(right, pitch) * Quaternion.RotationAxis(upVector, yaw);
- }
- }
-}
diff --git a/samples/Templates/ThirdPersonPlatformer/ThirdPersonPlatformer/ThirdPersonPlatformer.Game/Player/AnimationController.cs b/samples/Templates/ThirdPersonPlatformer/ThirdPersonPlatformer/ThirdPersonPlatformer.Game/Player/AnimationController.cs
index 174e2d15c..a3ab4816a 100644
--- a/samples/Templates/ThirdPersonPlatformer/ThirdPersonPlatformer/ThirdPersonPlatformer.Game/Player/AnimationController.cs
+++ b/samples/Templates/ThirdPersonPlatformer/ThirdPersonPlatformer/ThirdPersonPlatformer.Game/Player/AnimationController.cs
@@ -139,8 +139,7 @@ namespace ThirdPersonPlatformer.Player
animationClipWalkLerp2 = AnimationRun;
}
- // Use DrawTime rather than UpdateTime
- var time = Game.DrawTime;
+ var time = Game.UpdateTime;
// This update function will account for animation with different durations, keeping a current time relative to the blended maximum duration
long blendedMaxDuration = 0;
blendedMaxDuration =
@@ -150,7 +149,7 @@ namespace ThirdPersonPlatformer.Player
currentTicks = blendedMaxDuration == 0
? TimeSpan.Zero
- : TimeSpan.FromTicks((currentTicks.Ticks + (long)(time.Elapsed.Ticks * TimeFactor)) %
+ : TimeSpan.FromTicks((currentTicks.Ticks + (long)(time.WarpElapsed.Ticks * TimeFactor)) %
blendedMaxDuration);
currentTime = ((double)currentTicks.Ticks / (double)blendedMaxDuration);
@@ -160,7 +159,7 @@ namespace ThirdPersonPlatformer.Player
{
var speedFactor = 1;
var currentTicks = TimeSpan.FromTicks((long)(currentTime * AnimationJumpStart.Duration.Ticks));
- var updatedTicks = currentTicks.Ticks + (long)(Game.DrawTime.Elapsed.Ticks * TimeFactor * speedFactor);
+ var updatedTicks = currentTicks.Ticks + (long)(Game.UpdateTime.WarpElapsed.Ticks * TimeFactor * speedFactor);
if (updatedTicks < AnimationJumpStart.Duration.Ticks)
{
@@ -177,10 +176,9 @@ namespace ThirdPersonPlatformer.Player
private void UpdateAirborne()
{
- // Use DrawTime rather than UpdateTime
- var time = Game.DrawTime;
+ var time = Game.UpdateTime;
var currentTicks = TimeSpan.FromTicks((long)(currentTime * AnimationJumpMid.Duration.Ticks));
- currentTicks = TimeSpan.FromTicks((currentTicks.Ticks + (long)(time.Elapsed.Ticks * TimeFactor)) %
+ currentTicks = TimeSpan.FromTicks((currentTicks.Ticks + (long)(time.WarpElapsed.Ticks * TimeFactor)) %
AnimationJumpMid.Duration.Ticks);
currentTime = ((double)currentTicks.Ticks / (double)AnimationJumpMid.Duration.Ticks);
}
@@ -189,7 +187,7 @@ namespace ThirdPersonPlatformer.Player
{
var speedFactor = 1;
var currentTicks = TimeSpan.FromTicks((long)(currentTime * AnimationJumpEnd.Duration.Ticks));
- var updatedTicks = currentTicks.Ticks + (long) (Game.DrawTime.Elapsed.Ticks * TimeFactor * speedFactor);
+ var updatedTicks = currentTicks.Ticks + (long) (Game.UpdateTime.WarpElapsed.Ticks * TimeFactor * speedFactor);
if (updatedTicks < AnimationJumpEnd.Duration.Ticks)
{
diff --git a/samples/Templates/ThirdPersonPlatformer/ThirdPersonPlatformer/ThirdPersonPlatformer.Game/Player/PlayerController.cs b/samples/Templates/ThirdPersonPlatformer/ThirdPersonPlatformer/ThirdPersonPlatformer.Game/Player/PlayerController.cs
index 498bfeeae..2df7f0dbe 100644
--- a/samples/Templates/ThirdPersonPlatformer/ThirdPersonPlatformer/ThirdPersonPlatformer.Game/Player/PlayerController.cs
+++ b/samples/Templates/ThirdPersonPlatformer/ThirdPersonPlatformer/ThirdPersonPlatformer.Game/Player/PlayerController.cs
@@ -61,7 +61,6 @@ namespace ThirdPersonPlatformer.Player
///
public override void Update()
{
- // var dt = Game.UpdateTime.Elapsed.Milliseconds * 0.001;
Move(MaxRunSpeed);
Jump();
diff --git a/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Core/Utils.cs b/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Core/Utils.cs
index e6527c090..58e6d5694 100644
--- a/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Core/Utils.cs
+++ b/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Core/Utils.cs
@@ -77,7 +77,7 @@ namespace TopDownRPG.Core
while (secondsCountdown > 0f)
{
await script.Script.NextFrame();
- secondsCountdown -= (float)script.Game.UpdateTime.Elapsed.TotalSeconds;
+ secondsCountdown -= (float)script.Game.UpdateTime.WarpElapsed.TotalSeconds;
}
// Remove
diff --git a/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Gameplay/CoinScript.cs b/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Gameplay/CoinScript.cs
index 366162b3b..206b4371f 100644
--- a/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Gameplay/CoinScript.cs
+++ b/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Gameplay/CoinScript.cs
@@ -43,7 +43,7 @@ namespace TopDownRPG.Gameplay
public void UpdateAnimation()
{
- var dt = (float) Game.UpdateTime.Elapsed.TotalSeconds;
+ var dt = (float) Game.UpdateTime.WarpElapsed.TotalSeconds;
Entity.Transform.Rotation *= Quaternion.RotationMatrix(Matrix.RotationY(spinSpeed * (float)(dt * Math.PI)));
if (!activated)
diff --git a/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Gameplay/CrateScript.cs b/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Gameplay/CrateScript.cs
index 84b1ed9e6..53f28347f 100644
--- a/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Gameplay/CrateScript.cs
+++ b/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Gameplay/CrateScript.cs
@@ -46,7 +46,7 @@ namespace TopDownRPG.Gameplay
if (!activated)
return;
- var dt = (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ var dt = (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
animationTime += dt * 8;
var coinHeight = Math.Max(0, Math.Sin(animationTime));
diff --git a/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Gameplay/LootCoinScript.cs b/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Gameplay/LootCoinScript.cs
index 9d3d164fd..07932bb25 100644
--- a/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Gameplay/LootCoinScript.cs
+++ b/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Gameplay/LootCoinScript.cs
@@ -44,7 +44,7 @@ namespace TopDownRPG.Gameplay
public void UpdateAnimation()
{
- var dt = (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ var dt = (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
if (!activated)
return;
diff --git a/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Player/AnimationController.cs b/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Player/AnimationController.cs
index 9dfe874a3..535e5c2cb 100644
--- a/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Player/AnimationController.cs
+++ b/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Player/AnimationController.cs
@@ -121,8 +121,7 @@ namespace TopDownRPG.Player
animationClipWalkLerp2 = AnimationRun;
}
- // Use DrawTime rather than UpdateTime
- var time = Game.DrawTime;
+ var time = Game.UpdateTime;
// This update function will account for animation with different durations, keeping a current time relative to the blended maximum duration
long blendedMaxDuration = 0;
blendedMaxDuration =
@@ -132,7 +131,7 @@ namespace TopDownRPG.Player
currentTicks = blendedMaxDuration == 0
? TimeSpan.Zero
- : TimeSpan.FromTicks((currentTicks.Ticks + (long)(time.Elapsed.Ticks * TimeFactor)) %
+ : TimeSpan.FromTicks((currentTicks.Ticks + (long)(time.WarpElapsed.Ticks * TimeFactor)) %
blendedMaxDuration);
currentTime = ((double)currentTicks.Ticks / (double)blendedMaxDuration);
@@ -142,7 +141,7 @@ namespace TopDownRPG.Player
{
var speedFactor = 1;
var currentTicks = TimeSpan.FromTicks((long)(currentTime * AnimationPunch.Duration.Ticks));
- var updatedTicks = currentTicks.Ticks + (long)(Game.DrawTime.Elapsed.Ticks * TimeFactor * speedFactor);
+ var updatedTicks = currentTicks.Ticks + (long)(Game.UpdateTime.WarpElapsed.Ticks * TimeFactor * speedFactor);
if (updatedTicks < AnimationPunch.Duration.Ticks)
{
diff --git a/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Player/PlayerController.cs b/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Player/PlayerController.cs
index 9d1543a58..6372b16da 100644
--- a/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Player/PlayerController.cs
+++ b/samples/Templates/TopDownRPG/TopDownRPG/TopDownRPG.Game/Player/PlayerController.cs
@@ -123,7 +123,7 @@ namespace TopDownRPG.Player
private void Attack()
{
- var dt = (float) Game.UpdateTime.Elapsed.TotalSeconds;
+ var dt = (float) Game.UpdateTime.WarpElapsed.TotalSeconds;
attackCooldown = (attackCooldown > 0) ? attackCooldown - dt : 0f;
PunchCollision.Enabled = (attackCooldown > 0);
diff --git a/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/DeltaTimeDemo.cs b/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/DeltaTimeDemo.cs
index abfe9c572..4c31223cf 100644
--- a/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/DeltaTimeDemo.cs
+++ b/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/DeltaTimeDemo.cs
@@ -30,7 +30,7 @@ namespace CSharpBeginner.Code
public override void Update()
{
/// We can access Delta time through the static 'Game' object.
- var deltaTime = (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ var deltaTime = (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
// We update the total time
totalTime += deltaTime;
diff --git a/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/KeyboardInputDemo.cs b/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/KeyboardInputDemo.cs
index 2b0ef4193..f48dc6f69 100644
--- a/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/KeyboardInputDemo.cs
+++ b/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/KeyboardInputDemo.cs
@@ -27,7 +27,7 @@ namespace CSharpBeginner.Code
DebugText.Print("Hold the 1 key down to rotate the blue teapot", new Int2(340, 500));
if (Input.IsKeyDown(Keys.D1))
{
- var deltaTime = (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ var deltaTime = (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
BlueTeapot.Transform.Rotation *= Quaternion.RotationY(0.3f * deltaTime);
}
diff --git a/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/LerpDemo.cs b/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/LerpDemo.cs
index 211508ced..6c457833d 100644
--- a/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/LerpDemo.cs
+++ b/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/LerpDemo.cs
@@ -30,7 +30,7 @@ namespace CSharpBeginner.Code
public override void Update()
{
// Keep track of elapsed time
- var deltaTime = (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ var deltaTime = (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
elapsedTime += deltaTime;
// In order to make use of the lerp method, we need to calculate the 'interpolation value': a value going from 0 to 1.
diff --git a/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/MouseInputDemo.cs b/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/MouseInputDemo.cs
index 53010f74a..bf3d553f8 100644
--- a/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/MouseInputDemo.cs
+++ b/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/MouseInputDemo.cs
@@ -30,7 +30,7 @@ namespace CSharpBeginner.Code
DebugText.Print("Hold the left mouse button down to rotate the blue teapot", new Int2(400, 600));
if (Input.IsMouseButtonDown(MouseButton.Left))
{
- var deltaTime = (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ var deltaTime = (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
BlueTeapot.Transform.Rotation *= Quaternion.RotationY(0.4f * deltaTime);
}
diff --git a/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/RemoveEntitiesDemo.cs b/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/RemoveEntitiesDemo.cs
index d177b4d69..7b4f4c8de 100644
--- a/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/RemoveEntitiesDemo.cs
+++ b/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/RemoveEntitiesDemo.cs
@@ -49,7 +49,7 @@ namespace CSharpBeginner.Code
public override void Update()
{
// We use a simple timer
- timer += (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ timer += (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
if (timer > currentTimer)
{
// If the entities exist, we remove them from the scene
diff --git a/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/VirtualButtonsDemo.cs b/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/VirtualButtonsDemo.cs
index 8d101f26b..42b02eb27 100644
--- a/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/VirtualButtonsDemo.cs
+++ b/samples/Tutorials/CSharpBeginner/CSharpBeginner/CSharpBeginner.Game/Code/VirtualButtonsDemo.cs
@@ -49,7 +49,7 @@ namespace CSharpBeginner.Code
// Note: Gamepad sticks can be a negative value. For this example we only check if the value is higher than 0
if (forward > 0)
{
- var deltaTime = (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ var deltaTime = (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
BlueTeapot.Transform.Rotation *= Quaternion.RotationY(0.6f * forward * deltaTime);
}
diff --git a/samples/Tutorials/CSharpIntermediate/CSharpIntermediate/CSharpIntermediate.Game/11_Navigation/NavigateCharacter.cs b/samples/Tutorials/CSharpIntermediate/CSharpIntermediate/CSharpIntermediate.Game/11_Navigation/NavigateCharacter.cs
index 60f463d3e..c2e607a7f 100644
--- a/samples/Tutorials/CSharpIntermediate/CSharpIntermediate/CSharpIntermediate.Game/11_Navigation/NavigateCharacter.cs
+++ b/samples/Tutorials/CSharpIntermediate/CSharpIntermediate/CSharpIntermediate.Game/11_Navigation/NavigateCharacter.cs
@@ -48,7 +48,7 @@ namespace CSharpIntermediate.Code
return;
}
- var deltaTime = (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ var deltaTime = (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
var curPosition = RegularCharacter.Transform.WorldMatrix.TranslationVector;
var nextWaypointPosition = waypoints[waypointIndex];
var distanceToWaypoint = Vector3.Distance(curPosition, nextWaypointPosition);
diff --git a/samples/Tutorials/CSharpIntermediate/CSharpIntermediate/CSharpIntermediate.Game/Utils/OmniDirectionMovement.cs b/samples/Tutorials/CSharpIntermediate/CSharpIntermediate/CSharpIntermediate.Game/Utils/OmniDirectionMovement.cs
index 014855849..2ff26401a 100644
--- a/samples/Tutorials/CSharpIntermediate/CSharpIntermediate/CSharpIntermediate.Game/Utils/OmniDirectionMovement.cs
+++ b/samples/Tutorials/CSharpIntermediate/CSharpIntermediate/CSharpIntermediate.Game/Utils/OmniDirectionMovement.cs
@@ -55,7 +55,7 @@ namespace CSharpIntermediate.Code
movement.X -= 1;
}
- var delta = (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ var delta = (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
Entity.Transform.Position += movement * delta * MoveSpeed;
}
}
diff --git a/samples/UI/UIParticles/UIParticles.Game/SplashScript.cs b/samples/UI/UIParticles/UIParticles.Game/SplashScript.cs
index f7da3a989..9734128ac 100644
--- a/samples/UI/UIParticles/UIParticles.Game/SplashScript.cs
+++ b/samples/UI/UIParticles/UIParticles.Game/SplashScript.cs
@@ -211,7 +211,7 @@ namespace UIParticles
while (secondsCountdown > 0f)
{
await Script.NextFrame();
- secondsCountdown -= (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ secondsCountdown -= (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
}
// Remove
@@ -283,7 +283,7 @@ namespace UIParticles
private void DrawFuse()
{
- fusePercentage = Math.Min(1f, fusePercentage - (float)Game.UpdateTime.Elapsed.TotalSeconds * 0.04f);
+ fusePercentage = Math.Min(1f, fusePercentage - (float)Game.UpdateTime.WarpElapsed.TotalSeconds * 0.04f);
var gaugeCurrentRegion = lifeBarGaugeImage.Region;
gaugeCurrentRegion.Width = Math.Max(1, fusePercentage * gaugeBarRegion.Width);
@@ -323,7 +323,7 @@ namespace UIParticles
private void NewGameState()
{
- fusePercentage = Math.Min(1f, fusePercentage - (float)Game.UpdateTime.Elapsed.TotalSeconds * 0.03f);
+ fusePercentage = Math.Min(1f, fusePercentage - (float)Game.UpdateTime.WarpElapsed.TotalSeconds * 0.03f);
DrawFuse();
if (desiredState == GameState.EndGame || fusePercentage <= 0f)
diff --git a/sources/editor/Stride.Assets.Presentation/Templates/Assets/Scripts/Animation/AnimationBlend.cs b/sources/editor/Stride.Assets.Presentation/Templates/Assets/Scripts/Animation/AnimationBlend.cs
index ad13736e4..ce02fc4e9 100644
--- a/sources/editor/Stride.Assets.Presentation/Templates/Assets/Scripts/Animation/AnimationBlend.cs
+++ b/sources/editor/Stride.Assets.Presentation/Templates/Assets/Scripts/Animation/AnimationBlend.cs
@@ -58,8 +58,7 @@ public class ##Scriptname## : SyncScript, IBlendTreeBuilder
public override void Update()
{
- // Use DrawTime rather than UpdateTime
- var time = Game.DrawTime;
+ var time = Game.UpdateTime;
// This update function will account for animation with different durations, keeping a current time relative to the blended maximum duration
long blendedMaxDuration = 0;
@@ -67,7 +66,7 @@ public class ##Scriptname## : SyncScript, IBlendTreeBuilder
var currentTicks = TimeSpan.FromTicks((long)(currentTime * blendedMaxDuration));
- currentTicks = blendedMaxDuration == 0 ? TimeSpan.Zero : TimeSpan.FromTicks((currentTicks.Ticks + (long)(time.Elapsed.Ticks * TimeFactor)) % blendedMaxDuration);
+ currentTicks = blendedMaxDuration == 0 ? TimeSpan.Zero : TimeSpan.FromTicks((currentTicks.Ticks + (long)(time.WarpElapsed.Ticks * TimeFactor)) % blendedMaxDuration);
currentTime = (currentTicks.Ticks/(double) blendedMaxDuration);
}
diff --git a/sources/editor/Stride.Assets.Presentation/Templates/Assets/Scripts/Events/EventBroadcaster.cs b/sources/editor/Stride.Assets.Presentation/Templates/Assets/Scripts/Events/EventBroadcaster.cs
index 8c65c5e4c..c3abc47de 100644
--- a/sources/editor/Stride.Assets.Presentation/Templates/Assets/Scripts/Events/EventBroadcaster.cs
+++ b/sources/editor/Stride.Assets.Presentation/Templates/Assets/Scripts/Events/EventBroadcaster.cs
@@ -44,7 +44,7 @@ public class ##Scriptname## : SyncScript
// Condition 2 - the trigger can be a time interval
if (TimeInterval > 0)
{
- timeIntervalCountdown -= (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ timeIntervalCountdown -= (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
if (timeIntervalCountdown <= 0f)
{
timeIntervalCountdown = TimeInterval;
diff --git a/sources/editor/Stride.Assets.Presentation/Templates/Assets/Scripts/Physics/PlayerController.cs b/sources/editor/Stride.Assets.Presentation/Templates/Assets/Scripts/Physics/PlayerController.cs
index 248262dca..fbe502296 100644
--- a/sources/editor/Stride.Assets.Presentation/Templates/Assets/Scripts/Physics/PlayerController.cs
+++ b/sources/editor/Stride.Assets.Presentation/Templates/Assets/Scripts/Physics/PlayerController.cs
@@ -97,7 +97,7 @@ public class ##Scriptname## : SyncScript
var rotationDelta = Input.MouseDelta;
// Compute translation speed according to framerate and modifiers
- var translationSpeed = Speed * (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ var translationSpeed = Speed * (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
// Take shortest path
var deltaPitch = desiredPitch - pitch;
@@ -109,7 +109,7 @@ public class ##Scriptname## : SyncScript
desiredYaw = yaw + deltaYaw;
// Perform orientation transition
- var rotationAdaptation = (float)Game.UpdateTime.Elapsed.TotalSeconds * RotationAdaptationSpeed;
+ var rotationAdaptation = (float)Game.UpdateTime.WarpElapsed.TotalSeconds * RotationAdaptationSpeed;
yaw = Math.Abs(deltaYaw) < rotationAdaptation ? desiredYaw : yaw + rotationAdaptation * Math.Sign(deltaYaw);
pitch = Math.Abs(deltaPitch) < rotationAdaptation ? desiredPitch : pitch + rotationAdaptation * Math.Sign(deltaPitch);
diff --git a/sources/editor/Stride.Assets.Presentation/Templates/Assets/Scripts/Prefabs/PrefabInstance.cs b/sources/editor/Stride.Assets.Presentation/Templates/Assets/Scripts/Prefabs/PrefabInstance.cs
index e1ac8e0fb..6a921601a 100644
--- a/sources/editor/Stride.Assets.Presentation/Templates/Assets/Scripts/Prefabs/PrefabInstance.cs
+++ b/sources/editor/Stride.Assets.Presentation/Templates/Assets/Scripts/Prefabs/PrefabInstance.cs
@@ -69,7 +69,7 @@ public class ##Scriptname## : AsyncScript
if (TimeInterval > 0)
{
- timeIntervalCountdown -= (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ timeIntervalCountdown -= (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
if (timeIntervalCountdown <= 0f)
{
timeIntervalCountdown = TimeInterval;
@@ -115,7 +115,7 @@ public class ##Scriptname## : AsyncScript
while (secondsCountdown > 0f)
{
await Script.NextFrame();
- secondsCountdown -= (float)Game.UpdateTime.Elapsed.TotalSeconds;
+ secondsCountdown -= (float)Game.UpdateTime.WarpElapsed.TotalSeconds;
}
// Remove