Exemplo n.º 1
0
    private IEnumerator InactiveBehavior()
    {
        yield return(new WaitUntil(() => isInactive));

        lastActiveSnippet.SetSnippetInactive();

        yield return(new WaitForSeconds(3));

        while (isInactive)
        {
            Sequence seq = lastActiveSnippet.GetInactivitySequence();

            seq.Play();

            yield return(seq.WaitForCompletion());

            yield return(new WaitForSeconds(2f + Random.Range(0, 10)));
        }
    }