Skip to content

Item timing #6

Answered by ChebanovDD
umitgoren asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

I think there are two ways to prevent overlaps.

First way

The first way is to change the PrependInterval based on the item RowIndex (for example).

public class ItemsMoveJob : MoveJob
{
    ...

    public override async UniTask ExecuteAsync(CancellationToken cancellationToken = default)
    {
        var itemsSequence = DOTween.Sequence();

        foreach (var itemData in _itemsData)
        {
            var itemMoveTween = CreateItemMoveTween(itemData);

            // Use your own math here.
            var rowIndexBasedInterval = (1 - itemData.RowIndex / 10.0f) * IntervalDuration;
            
            _ = itemsSequence
                .Join(itemMoveTween)
                .Pre…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by umitgoren
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants