Browse Source

Blocks and 1st command select automatically when executed

master
chrisgregan 10 years ago
parent
commit
4e1ee2e123
  1. 17
      Assets/Fungus/Flowchart/Scripts/Block.cs

17
Assets/Fungus/Flowchart/Scripts/Block.cs

@ -158,18 +158,12 @@ namespace Fungus
executionState = ExecutionState.Executing;
#if UNITY_EDITOR
// If no block is currently executing, then automatically select this block for display in the inspector.
bool found = false;
foreach (Block block in flowchart.GetComponentsInChildren<Block>())
// Select the executing block & the first command
flowchart.selectedBlock = this;
if (commandList.Count > 0)
{
if (block.executionState == ExecutionState.Executing)
{
found = true;
}
}
if (found)
{
flowchart.selectedBlock = this;
flowchart.ClearSelectedCommands();
flowchart.AddSelectedCommand(commandList[0]);
}
#endif
@ -245,7 +239,6 @@ namespace Fungus
executionState = ExecutionState.Idle;
activeCommand = null;
flowchart.ClearSelectedCommands();
}
public virtual void Stop()

Loading…
Cancel
Save