public virtual void StopParentBlock() { OnExit(); if (parentBlock != null) { parentBlock.Stop(); } }
protected void PlayCommand() { Block targetBlock = target as Block; Flowchart flowchart = targetBlock.GetFlowchart(); Command command = flowchart.selectedCommands[0]; if (targetBlock.IsExecuting()) { // The Block is already executing. // Tell the Block to stop, wait a little while so the executing command has a // chance to stop, and then start execution again from the new command. targetBlock.Stop(); flowchart.StartCoroutine(RunBlock(flowchart, targetBlock, command.commandIndex, 0.2f)); } else { // Block isn't executing yet so can start it now. flowchart.ExecuteBlock(targetBlock, command.commandIndex); } }
public override void OnEnter() { if (blockName.Value == "") { Continue(); } if (flowchart == null) { flowchart = GetFlowchart(); } Block block = flowchart.FindBlock(blockName.Value); if (block == null || !block.IsExecuting()) { Continue(); } block.Stop(); Continue(); }