Delegates (callbacks)

Lazlo Bonin (Lead Developer) 3 years ago updated 1 year ago 6

Delegates, or callbacks, allow passing a function or action as a value so that it can be invoked later with arbitrary parameters. At the moment, this is pretty much the last feature of C# that is not possible in Bolt.

Implementing this would require:

  • Designing and implementing a new visual representation for graphs-as-values
  • Implementing code to convert a delegate call to a graph invocation

This is no small task and requires quite a bit of research, but I'm putting it up here for discussion and tracking.

Bolt Version:
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):

Hi mate, has this been implemented? I am wanting to avoid UnityEvents due to the speed.



Not yet, but it's the next item on the Alpha roadmap after the current release. It's scheduled for Bolt 2 alpha 5.

Most UGUI runs on UnityEvents and Delegates. Anyone experience the same problem?

Hi Louis!

You can use UnityEvents with Bolt. Simply have the event to FlowMachine.TriggerUnityEvent, then use the UnityEvent unit with the same name:

More documentation in the manual here: https://support.ludiq.io/knowledge-bases/4/articles/137-events

(End of the page)


Done in Bolt 2 Alpha 4!