Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - exkise

Pages: [1]
1
DOTween & DOTween Pro / Kill nested Sequence
« on: November 19, 2015, 10:59:42 AM »
Hi,

I'd like to use nested sequence but I need to be able to stop the nested sequence and can't reach this.

here's an example pseudo code :

Code: [Select]
    Sequence _sequence;
    Sequence _sequence1;

    public void Start()
    {
        _sequence = DOTween.Sequence();
        _sequence1 = DOTween.Sequence();

        _sequence1.AppendInterval(5f).OnComplete(() => Debug.Log("Completed"));

        _sequence.AppendCallback(() => Debug.Log("Do Some stuff"));
        _sequence.Append(_sequence1); // wait 5 seconds then log "Completed"
        _sequence.AppendCallback(() => Debug.Log("Do Some more stuff"));
    }
   
    void Update()
    {
        if(some_condition)
        {
                Debug.Log("Try to kill");
                _sequence1.Kill(true);
        }
    }

In the above code, consider that some_condition is, in my test case, true at some point of the execution of _sequence1, but _sequence1 never get killed...

How can I achieve that ? Is there something that I'm not aware about ?

Thanks in advance

Pages: [1]