|
If I call
from within my behavior script, does this automatically stop all running coroutines on the object? Long winded background: I've got a component attached to a GameObject that implements my game's rules through a series of coroutines. Essentially, it boils down to "do stuff, wait a few seconds, do more stuff". Sometimes, I want to pause this object, run the rules on a different object, then resume the original object. I was hoping that I could achieve this by activating and deactivating the appropriate objects, but reactivating the first object doesn't resume the old coroutines.
(comments are locked)
|
|
Ok, wading through answers tagged with "active" revealed the answer (whereas those with coroutine did not, strangely). Yes, deactivating an object kills its coroutines. I may try disabling just the component instead. More details in this Q&A.
(comments are locked)
|
|
Yes (as noted already) You can use OnEnable() to start the co-routine back up if needed: http://unity3d.com/support/documentation/ScriptReference/MonoBehaviour.OnEnable.html
(comments are locked)
|
