Created
April 21, 2018 22:04
-
-
Save darksinge/84ace258e797fb0002865a3e5f860bbd to your computer and use it in GitHub Desktop.
StartCoroutine from class that doesn't inherit from MonoBehavior
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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