+11
Completed

Delegates (callbacks)

Lazlo Bonin (Lead Developer) 3 years ago updated 2 years 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:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
+1

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

Cheers

+1

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)

+2
Completed

Done in Bolt 2 Alpha 4!