mirror of
https://github.com/DarthAffe/CUE.NET.git
synced 2025-12-13 00:58:31 +00:00
Added deltaTime-parameter to UpdatingEventArgs
This commit is contained in:
parent
5d1c8a1433
commit
d453cdc9bc
@ -64,6 +64,7 @@ namespace CUE.NET.Devices.Generic
|
|||||||
private CancellationTokenSource _updateTokenSource;
|
private CancellationTokenSource _updateTokenSource;
|
||||||
private CancellationToken _updateToken;
|
private CancellationToken _updateToken;
|
||||||
private Task _updateTask;
|
private Task _updateTask;
|
||||||
|
private DateTime _lastUpdate = DateTime.Now;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -356,7 +357,9 @@ namespace CUE.NET.Devices.Generic
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Updating?.Invoke(this, new UpdatingEventArgs());
|
long lastUpdateTicks = _lastUpdate.Ticks;
|
||||||
|
_lastUpdate = DateTime.Now;
|
||||||
|
Updating?.Invoke(this, new UpdatingEventArgs((float)((DateTime.Now.Ticks - lastUpdateTicks) / 10000000f)));
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,20 @@
|
|||||||
namespace CUE.NET.Devices.Generic.EventArgs
|
namespace CUE.NET.Devices.Generic.EventArgs
|
||||||
{
|
{
|
||||||
public class UpdatingEventArgs : System.EventArgs
|
public class UpdatingEventArgs : System.EventArgs
|
||||||
{ }
|
{
|
||||||
|
#region Properties & Fields
|
||||||
|
|
||||||
|
public float DeltaTime { get; }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Constructors
|
||||||
|
|
||||||
|
public UpdatingEventArgs(float deltaTime)
|
||||||
|
{
|
||||||
|
this.DeltaTime = deltaTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user