Give Page Feedback | API

Secondary Non Components - Simple Yield Break Equivalent Enumerator

This class has been created to provide an easy way to implement single frame execution implementations for methods with a return type of IEnumerator. It achieves the same effect as providing a single yield break statement in the method (when no other yields are present), however unlike the yield break construct, it does not result in garbage generation.

To use it, after placing all code that needs to run in the method, simply use the following line of code:

return SimpleYieldBreakEquivalentEnumerator.Instance;