Added FixedUpdates

This commit is contained in:
Michel Fedde 2021-03-17 14:12:31 +01:00
parent 777c2f6256
commit 21eaaa4900
8 changed files with 124 additions and 24 deletions

View file

@ -17,6 +17,24 @@
/// </summary>
public bool UseRender;
/// <summary>
/// The current update delta time.
/// </summary>
public static float UpdateDelta { get; internal set; }
public static float FixedUpdateDelta { get; set; }
/// <summary>
/// The current render delta time.
/// </summary>
public static float RenderDelta { get; internal set; }
/// <summary>
/// The calculated delta time.
/// </summary>
public float DeltaTime => (UseRender ? RenderDelta : UpdateDelta) * Scale;
/// <summary>
/// Creates a delta time assistant.
/// </summary>
@ -30,20 +48,5 @@
UseRender = useRender;
Scale = scale;
}
/// <summary>
/// The current update delta time.
/// </summary>
public static float UpdateDelta { get; internal set; }
/// <summary>
/// The current render delta time.
/// </summary>
public static float RenderDelta { get; internal set; }
/// <summary>
/// The calculated delta time.
/// </summary>
public float DeltaTime => (UseRender ? RenderDelta : UpdateDelta) * Scale;
}
}