Vixen
c7401864
csharp
public sealed class BehaviorTreeProjection

Turns a behaviour tree into the graph the canvas draws, and back again.

Read the guide page for this →

Remarks

⚠ A projection rather than the document itself, and that is doc 37 § D19's decision. The canvas draws a NodeGraph — boxes, ports and wires — and a behaviour tree is a tree with attachments and an ordered child list. Making the document be the canvas's model would mean either teaching the framework about ordered edges and attachments, which neither the shader graph nor the VFX graph nor the compositor has any use for, or teaching the tree to be a dataflow graph, which it is not. So the canvas gets a picture and every edit goes back through BehaviorTreeModel.

Each projected node carries its BehaviorNodeContent in Tag, which is how a click on a box becomes a selection in the document.

Fields and properties (2)

  • public NodeGraph Graph

    What the canvas shows.

  • public BehaviorTreeModel? Model

    The tree the last Project drew, so a live pass can ask it about types.

Methods (7)

Used by (1)

  • BehaviorTreeViewVixen.Editor.AssetEditors