/// <summary> /// run the block in a coroutine way /// </summary> IEnumerator RunBlock(Block block) { Game.commands.AddPuzzle(block.GetHashCode()); //Debug.LogFormat("<color=blue>RunBlock {0}</color>", block.GetHashCode()); //check flow if (ControlCmdtor.SkipRunByControlFlow(block)) { yield break; } if (!block.Disabled) { CSharp.Interpreter.FireUpdate(new InterpreterUpdateState(InterpreterUpdateState.RunBlock, block)); yield return(GetBlockInterpreter(block).Run(block)); CSharp.Interpreter.FireUpdate(new InterpreterUpdateState(InterpreterUpdateState.FinishBlock, block)); } if (block.NextBlock != null) { yield return(RunBlock(block.NextBlock)); } }