refactor: timer methods names cleaned up

This commit is contained in:
2025-04-06 17:26:57 +03:00
parent 98c9dde98a
commit 6f425776cc
6 changed files with 27 additions and 27 deletions

View File

@@ -4,16 +4,16 @@ public class TickerBehaviour : StopwatchBehaviour, ITicker
{
public event ITicker.TickerTickEventHandler? OnTick = null;
public double TickPeriod { get; set; } = 1f;
public double Period { get; set; } = 1f;
public int TickCounter { get; private set; } = 0;
private double nextTick = 0f;
public override void StopwatchStart()
public override void Start()
{
TickCounter = 0;
base.StopwatchStart();
nextTick = Time + TickPeriod;
base.Start();
nextTick = Time + Period;
}
protected override void OnUpdate()
@@ -23,7 +23,7 @@ public class TickerBehaviour : StopwatchBehaviour, ITicker
if (Time < nextTick)
return;
nextTick += TickPeriod;
nextTick += Period;
TickCounter++;
OnTick?.Invoke(this);
}