Chris Gregan
9 years ago
19 changed files with 1399 additions and 75 deletions
@ -0,0 +1,56 @@
|
||||
using UnityEngine; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace Fungus |
||||
{ |
||||
[CommandInfo("Flow", |
||||
"Stop Flowchart", |
||||
"Stops execution of all Blocks in a Flowchart")] |
||||
[AddComponentMenu("")] |
||||
public class StopFlowchart : Command |
||||
{ |
||||
[Tooltip("Stop all executing Blocks in the Flowchart that contains this command")] |
||||
public bool stopParentFlowchart; |
||||
|
||||
[Tooltip("Stop all executing Blocks in a list of target Flowcharts")] |
||||
public List<Flowchart> targetFlowcharts = new List<Flowchart>(); |
||||
|
||||
public override void OnEnter() |
||||
{ |
||||
Flowchart flowchart = GetFlowchart(); |
||||
|
||||
if (stopParentFlowchart) |
||||
{ |
||||
flowchart.StopAllBlocks(); |
||||
} |
||||
|
||||
foreach (Flowchart f in targetFlowcharts) |
||||
{ |
||||
if (f == flowchart) |
||||
{ |
||||
// Flowchart has already been stopped |
||||
continue; |
||||
} |
||||
|
||||
f.StopAllBlocks(); |
||||
} |
||||
} |
||||
|
||||
public override bool IsReorderableArray(string propertyName) |
||||
{ |
||||
if (propertyName == "targetFlowcharts") |
||||
{ |
||||
return true; |
||||
} |
||||
|
||||
return false; |
||||
} |
||||
|
||||
public override Color GetButtonColor() |
||||
{ |
||||
return new Color32(235, 191, 217, 255); |
||||
} |
||||
} |
||||
|
||||
} |
@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2 |
||||
guid: ae67a23cb4aa74793b41258ae40bf321 |
||||
timeCreated: 1442408419 |
||||
licenseType: Free |
||||
MonoImporter: |
||||
serializedVersion: 2 |
||||
defaultReferences: [] |
||||
executionOrder: 0 |
||||
icon: {instanceID: 0} |
||||
userData: |
||||
assetBundleName: |
||||
assetBundleVariant: |
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue