Quantcast
Channel: Questions in topic: "warnings"
Viewing all articles
Browse latest Browse all 187

coroutines - get compile (or runtime) warning when called as a normal method ?

$
0
0
In the following code example, the coroutine is being called as a normal method - ie, not from a yield in another coroutine and not via StartCoroutine(). the result is that **none** of the code in the coroutine is executed. i would love to get a runtime error in this situation, or even better, a compile-time error. anybody know how to do that ? void test() { Debug.log("before calling coroutine"); // prints myCoroutine(); Debug.log("after calling coroutine"); // prints } IEnumerator myCoroutine() { Debug.log("inside the coroutine"); // does not print yield break; }

Viewing all articles
Browse latest Browse all 187

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>