Class ScriptGraphRunner
The script graph runner is a component that acts as a wrapper for the script graph processor, so that it can be run easily in the editor or at runtime without writing any additional code.
Inheritance
Implements
Inherited Members
Namespace: InsaneScatterbrain.ScriptGraph
Syntax
[AddComponentMenu("Map Graph/Map Graph Runner")]
public class ScriptGraphRunner : ScriptGraphMonoBehaviour, IVersioned
Properties
Graph
Declaration
public ScriptGraphGraph Graph { get; }
Property Value
Type | Description |
---|---|
ScriptGraphGraph |
GraphProcessor
Gets the graph processor.
Declaration
public ScriptGraphProcessor GraphProcessor { get; }
Property Value
Type | Description |
---|---|
ScriptGraphProcessor |
IsRunning
Declaration
public bool IsRunning { get; }
Property Value
Type | Description |
---|---|
bool |
LatestResult
Declaration
public IReadOnlyDictionary<string, object> LatestResult { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyDictionary<TKey, TValue><string, object> |
MainThreadTimePerFrameLimitEnabled
Declaration
public bool MainThreadTimePerFrameLimitEnabled { get; }
Property Value
Type | Description |
---|---|
bool |
ParamsInData
Declaration
public DataBag ParamsInData { get; }
Property Value
Type | Description |
---|---|
DataBag |
RunAsynchronously
Declaration
public bool RunAsynchronously { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
GetIn(string)
Declaration
public object GetIn(string inName)
Parameters
Type | Name | Description |
---|---|---|
string | inName |
Returns
Type | Description |
---|---|
object |
GetIn<T>(string)
Gets the current value for the parameter associated with the given name.
Declaration
public T GetIn<T>(string inName)
Parameters
Type | Name | Description |
---|---|---|
string | inName | The parameters name. |
Returns
Type | Description |
---|---|
T | The value. |
Type Parameters
Name | Description |
---|---|
T | The parameter's type. |
Run()
Runs the script graph processor. If run asynchronously is true, it will run its own thread (with the exception if Unity API stuff of course). It will run on synchronously on the main thread otherwise.
Declaration
public void Run()
RunAsync()
Runs the script graph processor asynchronously.
Declaration
public void RunAsync()
RunSync()
Runs the script graph processor synchronously.
Declaration
public void RunSync()
SetIn(string, object)
Sets the value for the parameter associated with the given name.
Declaration
public void SetIn(string inName, object value)
Parameters
Type | Name | Description |
---|---|---|
string | inName | The parameter's name. |
object | value | The value. |
SetInById(string, object)
Declaration
public void SetInById(string id, object value)
Parameters
Type | Name | Description |
---|---|---|
string | id | |
object | value |
SetIsSeedRandom(bool)
Sets whether or not the RNG seed is randomized.
Declaration
public void SetIsSeedRandom(bool isSeedRandom)
Parameters
Type | Name | Description |
---|---|---|
bool | isSeedRandom | Whether the seed is random. |
SetStaticSeed(int)
Sets a static seed on the graph processor.
Declaration
public void SetStaticSeed(int seed)
Parameters
Type | Name | Description |
---|---|---|
int | seed | The RNG seed. |
SetStaticSeed(string)
Sets a static seed on the graph processor.
Declaration
public void SetStaticSeed(string seed)
Parameters
Type | Name | Description |
---|---|---|
string | seed | The RNG seed. |
Events
OnChecksFailed
Global event that's called whenever checks fail when a graph is ran by any script graph runner.
Declaration
public static event Action<ScriptGraphRunner, IEnumerable<IScriptNode>> OnChecksFailed
Event Type
Type | Description |
---|---|
System.Action<T1, T2><ScriptGraphRunner, System.Collections.Generic.IEnumerable<T><IScriptNode>> |
OnError
Event that is triggered each time the script graph processor fails processing.
Declaration
public event Action OnError
Event Type
Type | Description |
---|---|
System.Action |
OnProcessed
Event that is triggered each time the script graph processor is done processing.
Declaration
public event Action<IReadOnlyDictionary<string, object>> OnProcessed
Event Type
Type | Description |
---|---|
System.Action<T><System.Collections.Generic.IReadOnlyDictionary<TKey, TValue><string, object>> |
OnProgress
Declaration
public event Action<int, int> OnProgress
Event Type
Type | Description |
---|---|
System.Action<T1, T2><int, int> |
OnRun
Global event that's called whenever a graph runner is about to run.
Declaration
public static event Action<ScriptGraphRunner> OnRun
Event Type
Type | Description |
---|---|
System.Action<T><ScriptGraphRunner> |
OnStop
Global event that's called whenever a graph is stopped, finishing successfully or otherwise.
Declaration
public static event Action<ScriptGraphRunner> OnStop
Event Type
Type | Description |
---|---|
System.Action<T><ScriptGraphRunner> |