Demigiant Forum
Unity Assets => DOTween & DOTween Pro => Topic started by: Arkuni on July 01, 2015, 07:26:16 PM
-
The code below produces the following sequence: 2, 1
var seq = DOTween.Sequence();
seq.AppendCallback(() => Debug.Log(1));
seq.AppendCallback(() => Debug.Log(2));
The code below produces the following sequence: 1, 2
seq.AppendCallback(() => Debug.Log(1));
seq.AppendInterval(0.001f);
seq.AppendCallback(() => Debug.Log(2));
What is the correct way of appending callbacks and getting the correct sequence?
-
Callbacks that happen at the same time may happen randomly due to the storage logic. If you want to append two callbacks at the same exact moment, I'd recommend using a single one and adding multiple functions to it:
seq.AppendCallback(() => {
Debug.Log(1);
Debug.Log(2);
});