Run flow machine in editor

Zefugi 3 years ago updated by Lazlo Bonin (Lead Developer) 2 years ago 3

I got a bunch of functions for generating landscapes, and I would like to chain them together in a flow graph, to easily build different terrains. This part actually works fine, but I would like to run the flow graph in the editor, and that part causes some problems.

At the moment I got a semi-working version where I trigger a Unity event, that triggers the graph and it runs just fine. Problem is 2nd time I try to run it it doesn't trigger, and I have to remove the macro from the gameobject and re-attach it, to make it work again.

Bolt Version:
Latest from Assetstore
Unity Version:
Scripting Backend:
.NET Version (API Compatibility Level):
Satisfaction mark by Zefugi 2 years ago

At this moment this is not really possible. 

You can use on draw gizmo or on gizmo select in the editor but keep in mind that this works like a update event. 


Not sure if I understood correctly, but the Community addon has a Manual Event that you can trigger in Editor with a button on the Graph. Not sure if that fits your use-case or not though.



That is currently indeed the right approach. You could also link event firing logic to your custom editor / window / property drawer by using the Events API: https://ludiq.io/bolt/manual/scripting/events

For example:

if (GUILayout.Button("Trigger Event"))
    CustomEvent.Trigger(myGameObject, "EventName", argument1, argument2, etc.);