FlowCanvas Forums › Support › Call flowscript from C# script › Reply To: Call flowscript from C# script
Hello,
From c# code, you can both call custom functions created in a flowScript or even send events to flowscripts to react to.
On top of these two ways to call flowscript events and functions from code, flowscripts can also hook up to c# or Unity events declared in your code and subscribe to them and be called when the event is raised by your c# code.
Variables can also be set from c# code, yes. Variables in FlowCanvas are stored in a Blackboard component. As such you can do something like this for example:
1 2 3 4 5 6 | var bb = GetComponent<Blackboard>(); var number = bb.GetValue<float>("myFloat"); number ++; bb.SetValue("myFloat", number); |
Let me know if that is what you mean, or if you have any other questions.
Thank you.