Exemplo n.º 1
0
        /// <summary>
        /// run the block in a coroutine way
        /// </summary>
        IEnumerator RunBlock(Block block)
        {
            //check if stopped
            if (mRunningProcess == null)
            {
                yield break;
            }

            //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));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// run the block in a coroutine way
        /// </summary>
        IEnumerator RunBlock(Block block)
        {
            //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)
            {
                //判断是事件Block ("当")
                if ((block.PreviousConnection == null) && (block.NextConnection != null))
                {
                    block.Workspace.EventNextBlock = block.NextBlock;
                }
                else
                {
                    yield return(RunBlock(block.NextBlock));
                }
            }
        }
Exemplo n.º 3
0
        /// <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));
            }
        }