Hello!
I try to start an empty coroutine for a design reason. I can’t find a way to execute that coroutine without wait until the next frame to execute the next part of my code.
There is a sample code (the Execute() method is started with the StartCoroutine() method) :
public override IEnumerator Execute() {
Debug.Log("test2");
// Node controllable
INodeControllable nodeControllable = item.GetComponent<INodeControllable>();
if (nodeControllable != null) {
yield return StartCoroutine(Execute(nodeControllable));
}
Debug.Log("test3");
}
protected virtual IEnumerator Execute(INodeControllable node) {
yield break;
}
What I want is when a class doesn’t override the Execute method, “test2” and “test3” are logs in the same frame.
Is there something i’m missing here ?
Thanks!