I’m in need of means to check if how many times the recursive part of this function was activated to check when the first call was fulfilled, it’s part of the designed true game over that needs the first call to be fulfilled without achieving all objectives.
IEnumerator CompositeRun(string name)
{
BotOperation operation;
compositeOps.TryGetValue (name, out operation);
CompositeOperation compOp = operation as CompositeOperation;
List<BotOperation> botOpList = compOp.opList;
if (botOpList != null)
{
for (int i = 0; i < botOpList.Count; i++)
{
BotOperation op = botOpList *;*
CompositeOperation comp = op as CompositeOperation;
if (comp != null)
{
// If this operation is a composite type, then we need to execute it first accordingly.
yield return StartCoroutine (CompositeRun(comp.name));
}
if (op != null && op.ValidateOperation(gameObject, levelDef))
{
op.RunOperation (gameObject, levelDef);
if (CheckGameOver ())
{
// If all objectives are fulfilled, then there’s no need to continue running the processes, the stage is concluded.
StopAllCoroutines ();
}
}
yield return new WaitForSeconds (operationDelay);
}
}
yield return null;
}