perf: DelegateExtensions.InvokeSafe marked obsolete for memory allocation reasons, soon to be removed
This commit is contained in:
@@ -26,14 +26,14 @@ internal class Tween : ITween
|
||||
_state = value;
|
||||
switch (value)
|
||||
{
|
||||
case TweenState.Completed: OnCompleted?.InvokeSafe(this); OnEnded?.InvokeSafe(this); break;
|
||||
case TweenState.Cancelled: OnCancelled?.InvokeSafe(this); OnEnded?.InvokeSafe(this); break;
|
||||
case TweenState.Paused: OnPaused?.InvokeSafe(this); break;
|
||||
case TweenState.Completed: OnCompleted?.Invoke(this); OnEnded?.Invoke(this); break;
|
||||
case TweenState.Cancelled: OnCancelled?.Invoke(this); OnEnded?.Invoke(this); break;
|
||||
case TweenState.Paused: OnPaused?.Invoke(this); break;
|
||||
case TweenState.Playing:
|
||||
if (previousState == TweenState.Idle)
|
||||
OnStarted?.InvokeSafe(this);
|
||||
OnStarted?.Invoke(this);
|
||||
else
|
||||
OnResumed?.InvokeSafe(this);
|
||||
OnResumed?.Invoke(this);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -58,9 +58,9 @@ internal class Tween : ITween
|
||||
|
||||
_counter = value.Min(Duration).Max(0f);
|
||||
Progress = Counter / Duration;
|
||||
OnUpdated?.InvokeSafe(this);
|
||||
OnUpdated?.Invoke(this);
|
||||
|
||||
OnDeltaUpdated?.InvokeSafe(this, Easing.Evaluate(Progress) - Easing.Evaluate(previousProgress));
|
||||
OnDeltaUpdated?.Invoke(this, Easing.Evaluate(Progress) - Easing.Evaluate(previousProgress));
|
||||
|
||||
if (_counter >= Duration)
|
||||
State = TweenState.Completed;
|
||||
|
Reference in New Issue
Block a user