Page 1 sur 1

Tip #54: un IEnumerator pour vos Start()

Publié : 15 Avr 2019 08:22
par Max
Bonjour,

Image

un IEnumerator pour vos Start(), pour des séquences de démarrage temporisés:

Code : Tout sélectionner

    [SerializeField]
    float tempo1 = 2.0f;
    [SerializeField]
    float tempo2 = 3.0f;

    // Start is called before the first frame update
    private IEnumerator Start()
    {
        Debug.Log("demarrage");
        yield return new WaitForSeconds(tempo1);
        Debug.Log("Action1");
        yield return new WaitForSeconds(tempo2);
        Debug.Log("Action2");
    }

Re: Tip #54: un IEnumerator pour vos Start()

Publié : 23 Avr 2019 12:26
par DevAmat
Encore un truc que je connaissais pas.
Merci :super: !