Skip to content

Extension class for a Monobehaviour that allows for easy execution of a single Coroutine at a time.

Notifications You must be signed in to change notification settings

bartofzo/UnityMonoroutine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Extension class for a Monobehaviour that allows for easy execution a single Coroutine at a time.

Example of such a routine would be a fade in/fadeout routine, where one can interrupt the other. Provides an optional callback that is garantueed to be called when the coroutine stops (either by finishing execution or by interruption)

Usage

using UnityMonoroutine;

// Fades in CanvasGroup and then fades it out again
canvasGroup.alpha = 0;
this.StartMonoroutine(canvasGroup.AlphaFade(1, 1),
    () => this.StartMonoroutine(canvasGroup.AlphaFade(0, 1),
    () => Debug.Log("Finished!")));

Written by

Bart van de Sande / Nonline

About

Extension class for a Monobehaviour that allows for easy execution of a single Coroutine at a time.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages