Untitled

Anonymous
plain_text
03/03/2023 11:15 PM
844 B
18
Indexable
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Test : MonoBehaviour
{
    // Start is called before the first frame update
    private int contor = 0;

    public void TestCoroutine()
    {
        StartCoroutine(Abracadabra());
    }

    private IEnumerator Abracadabra()
    {
        contor++;
        float elapsedTime = 0;
        while (elapsedTime < 12f)
        {
            Debug.Log("Coroutine " + contor);
            elapsedTime += Time.deltaTime;

            yield return null;
        }

        Debug.Log("End Coroutine " + contor);
    }
}
Editor is loading...