@ -829,11 +829,7 @@ namespace Fungus
if ( showPlay )
if ( showPlay )
{
{
commandMenu . AddItem ( new GUIContent ( "Play from Selected Command" ) , false , PlayCommand ) ;
commandMenu . AddItem ( new GUIContent ( "Play from selected" ) , false , PlayCommand ) ;
}
else
{
commandMenu . AddDisabledItem ( new GUIContent ( "Play from Selected Command" ) ) ;
}
}
commandMenu . AddSeparator ( "" ) ;
commandMenu . AddSeparator ( "" ) ;
@ -1027,16 +1023,25 @@ namespace Fungus
Block targetBlock = target as Block ;
Block targetBlock = target as Block ;
Flowchart flowchart = targetBlock . GetFlowchart ( ) ;
Flowchart flowchart = targetBlock . GetFlowchart ( ) ;
Command command = flowchart . selectedCommands [ 0 ] ;
Command command = flowchart . selectedCommands [ 0 ] ;
if ( ! targetBlock . IsExecuting ( ) )
if ( targetBlock . IsExecuting ( ) )
{
{
flowchart . ExecuteBlock ( targetBlock , command . commandIndex ) ;
// 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
else
{
{
targetBlock . jumpToCommandIndex = command . commandIndex ;
// Block isn't executing yet so can start it now.
flowchart . ExecuteBlock ( targetBlock ) ;
flowchart . ExecuteBlock ( targetBlock , command . commandIndex ) ;
}
}
}
protected IEnumerator RunBlock ( Flowchart flowchart , Block targetBlock , int commandIndex , float delay )
{
yield return new WaitForSeconds ( delay ) ;
flowchart . ExecuteBlock ( targetBlock , commandIndex ) ;
}
}
protected void SelectPrevious ( )
protected void SelectPrevious ( )