IEnumerator (Native Component) for Routine

agan 4 years ago updated 4 years ago 3


I am looking for IEnumerator (native component), but still not found...

above, i see routine connection can only linked via custom c# scripts...

what i need are some of opening/ending gate component of IEnumerator , it will helpfull rather than write c# code...

or is there any way to create it...


Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):

As far as I know, you can start a coroutine, and stop them... But you have no control over routines in a Coroutine. There is one way to mimic this.

Use a state unit. Has a started and stopped exit port. These would be your opening and ending gate. Inside would be a state or your loop. Use a wait while or until unit connected to the stop port. Unfortunately you can't just call start and stop like a Coroutine, unless you create the stop and start as an event. 

Since IEnumerators can't be static, I'm not sure how to create a wrapper just yet. I've made a couple attempts.

Fortunately, that's next on my list of macros I really wanted to create. When I'm finished with my nested wait units (today or tomorrow) I'll head into this. It will have to act exactly how a user would use a Coroutine normally. So it should feel right at home. Only issue I'd need to figure out is firing multiple times, don't a new "instance", kind of tricky.

Under Review

State machines are the proper way of doing coroutines (and much more) in Bolt.

You can start and stop them with a state unit: http://support.ludiq.io/topics/196-state-units/