feat: safe delegate invocation helper added

This commit is contained in:
2025-04-13 19:08:47 +03:00
parent 00f7b1aaab
commit 58eb373c79
21 changed files with 116 additions and 91 deletions

View File

@@ -14,7 +14,7 @@ public class TweenManager : HierarchyObject
public ITween StartTween(float duration, TweenSetCallback? setCallback = null)
{
Tween tween = new(duration);
tween.OnUpdated += tween => setCallback?.Invoke(tween.Value);
tween.OnUpdated += tween => setCallback?.InvokeSafe(tween.Value);
runningCoroutines.Add(tween, coroutineManager.StartCoroutine(RunTween(tween)));
return tween;
}