perf: DelegateExtensions.InvokeSafe marked obsolete for memory allocation reasons, soon to be removed
This commit is contained in:
@@ -50,7 +50,7 @@ public class TimerBehaviour : Behaviour, ITimer
|
||||
shouldBeTicking = false;
|
||||
|
||||
State = TimerState.Stopped;
|
||||
OnStopped?.InvokeSafe(this);
|
||||
OnStopped?.Invoke(this);
|
||||
}
|
||||
|
||||
protected override void OnUpdate()
|
||||
@@ -61,7 +61,7 @@ public class TimerBehaviour : Behaviour, ITimer
|
||||
double delta = Universe.Time.DeltaSpan.TotalSeconds;
|
||||
|
||||
Remaining -= delta;
|
||||
OnDelta?.InvokeSafe(this, delta);
|
||||
OnDelta?.Invoke(this, delta);
|
||||
|
||||
if (Remaining <= .0f)
|
||||
Stop();
|
||||
@@ -89,13 +89,13 @@ public class TimerBehaviour : Behaviour, ITimer
|
||||
public virtual void Pause()
|
||||
{
|
||||
State = TimerState.Paused;
|
||||
OnPaused?.InvokeSafe(this);
|
||||
OnPaused?.Invoke(this);
|
||||
}
|
||||
|
||||
public virtual void Resume()
|
||||
{
|
||||
State = TimerState.Ticking;
|
||||
OnResumed?.InvokeSafe(this);
|
||||
OnResumed?.Invoke(this);
|
||||
}
|
||||
|
||||
private void StartTimer()
|
||||
@@ -103,7 +103,7 @@ public class TimerBehaviour : Behaviour, ITimer
|
||||
hasStartedTickingBefore = true;
|
||||
|
||||
State = TimerState.Ticking;
|
||||
OnStarted?.InvokeSafe(this);
|
||||
OnStarted?.Invoke(this);
|
||||
}
|
||||
|
||||
protected override void OnFinalize()
|
||||
|
||||
Reference in New Issue
Block a user