Howdy,
If I call a function that yields (is a coroutine) do I need to keep track that it’s running? Or can I safely call it multiple times to start it running if not already?
The situation is something like AI where I want the object to think periodically until it solves a problem and then it stops and returns from the coroutine, terminating it. Sometimes though it may be given a new problem to think about. In this case, can I call the StartThinking function without checking whether it’s already running? Or should I keep a variable that tracks whether the coroutine has terminated and only start it again if needed? (the StartThinking function has a queue so when it runs it will process however many jobs there are)
Thanks