dotween icon indicating copy to clipboard operation
dotween copied to clipboard

OnComplete problem (again of course) with singleton classes

Open kureysalp opened this issue 1 year ago • 0 comments

I have a singleton class that has an Integer. I am incrementing this integer by one when I start a tween and in OnComplete of that tween decreasing it by one. Each tween is created by separate objects.

Issue is if these I create these tweens so fast, in some of the OnCompletes ignores the singleton call but calls other thins with no problem.

transform.DOMove(slot.transform.position, moveTimeToSlots.Value).OnComplete(() => { GameStateManager.Instance.MethodSingleton(); // Sometimes not calling MethodOne(); // always calling MethodTwo(); // always calling });

Edit: When I call the MethodSingleton for example in MethodOne, it works flawlessly. So it's 100% OnComplete and Singleton problem.

kureysalp avatar Dec 21 '23 14:12 kureysalp