Skip to content

Instantly share code, notes, and snippets.

@darksinge
Created April 21, 2018 22:04
Show Gist options
  • Save darksinge/84ace258e797fb0002865a3e5f860bbd to your computer and use it in GitHub Desktop.
Save darksinge/84ace258e797fb0002865a3e5f860bbd to your computer and use it in GitHub Desktop.
StartCoroutine from class that doesn't inherit from MonoBehavior
class MyClass {
MyClass() {
APIManager manager = GameObject.FindWithTag("APIManager").GetComponent<APIManager>();
manager.StartCoroutine(MyFunction());
}
IEnumerator MyFunction() {
yield return "Hello World!";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment