refactor: timer methods names cleaned up
This commit is contained in:
@@ -31,7 +31,7 @@ public class TimerBehaviour : Behaviour, ITimer
|
||||
private bool shouldBeTicking = false;
|
||||
private bool hasStartedTickingBefore = false;
|
||||
|
||||
public virtual void TimerStart(double time)
|
||||
public virtual void Start(double time)
|
||||
{
|
||||
StartTime = time;
|
||||
Remaining = time;
|
||||
@@ -43,7 +43,7 @@ public class TimerBehaviour : Behaviour, ITimer
|
||||
StartTimer();
|
||||
}
|
||||
|
||||
public virtual void TimerStop()
|
||||
public virtual void Stop()
|
||||
{
|
||||
if (!shouldBeTicking)
|
||||
return;
|
||||
@@ -65,7 +65,7 @@ public class TimerBehaviour : Behaviour, ITimer
|
||||
OnDelta?.Invoke(this, delta);
|
||||
|
||||
if (Remaining <= .0f)
|
||||
TimerStop();
|
||||
Stop();
|
||||
}
|
||||
|
||||
protected override void OnEnteredHierarchy(IGameManager gameManager)
|
||||
@@ -74,7 +74,7 @@ public class TimerBehaviour : Behaviour, ITimer
|
||||
return;
|
||||
|
||||
if (hasStartedTickingBefore)
|
||||
TimerResume();
|
||||
Resume();
|
||||
else
|
||||
StartTimer();
|
||||
}
|
||||
@@ -84,16 +84,16 @@ public class TimerBehaviour : Behaviour, ITimer
|
||||
if (!shouldBeTicking || State is not TimerState.Ticking)
|
||||
return;
|
||||
|
||||
TimerPause();
|
||||
Pause();
|
||||
}
|
||||
|
||||
public virtual void TimerPause()
|
||||
public virtual void Pause()
|
||||
{
|
||||
State = TimerState.Paused;
|
||||
OnPaused?.Invoke(this);
|
||||
}
|
||||
|
||||
public virtual void TimerResume()
|
||||
public virtual void Resume()
|
||||
{
|
||||
State = TimerState.Ticking;
|
||||
OnResumed?.Invoke(this);
|
||||
|
||||
Reference in New Issue
Block a user