Playmaker Forum
PlayMaker Feedback => Action Requests => Topic started by: mindlube on August 31, 2011, 01:17:42 PM
-
surprised there is a Start Coroutine but not a start + wait for coroutine.
edit: actually never mind! It's BETTER to use Start Coroutine action, then just call a custom event transition at the end of a coroutine :)
-
Hmm, this is not as trivial as I thought to create my own Action. Please make OnEnter to be polymorphic to have IEnumerator return type. Much like Unity's Start and Awake methods may be void return or they may by coroutines (IEnumerator return type). That would add a great deal of flexibility about what kind of Actions can be created! (coming at this from a programmer's perpective)
-
Would you be interested in telling me what a Coroutine is for? I see them mentioned everywhere but i dont know what you use it for or really what it is..
If not thats ok too. :)
I assume it is like subroutine you want to jump to and wait for it to return with values maybe?
Q
-
@qholmes, in C# there is the keyword "yield". Unity's implementation of coroutines is pretty nice. They are commonly used in Unity to create game logic, even simple FSMs, in scripts with C# or Unity script. It's tremendously useful. Indispensable even. Start here
http://unity3d.com/support/documentation/ScriptReference/index.Coroutines_26_Yield.html
-
Hey thanks!!!!
I dont get what an IEnumerator is.. but i read quite a bit there and it made sense for the most part.. I have thought about this type of logic but did not know what it was called.. leaving one FSM and being able to return to the same spot upon return... I can see this being very beneficial.
Q
-
Actually, now that I dig into this a little more, when using the Start Coroutine action, it's only a single line of code to put at the end of my coroutine:
cachedFSM.ChangeState("proceed");
In fact this is so simple that there really is no need for a Start Coroutine and wait! Yay for extensible event transitions!