Vixen
c7401864
csharp
public sealed class BehaviorTreeModel

An editable behaviour tree: the document, plus everything a gesture needs to ask it.

Read the guide page for this →

Remarks

The document is BehaviorTreeContent — the same shape the file holds and the same shape the compiler takes — and this is the operations over it. There is no second model to keep in step, which is the bargain Vixen.Editor.AnimationGraph makes and for the same reason: two models is two places for a field to be added and one place for it to be forgotten.

⚠ Undo is a snapshot, not a per-field inverse. The node graphs use fine-grained commands because a shader graph is thousands of nodes and a snapshot per keystroke would be megabytes; a behaviour tree is tens of nodes, and a snapshot is a few kilobytes of strings. What that buys is that every gesture is undoable by construction — a reparent, a reorder, a key rename that rewrote forty references — with no chance of an inverse that restores four of the five things it changed. BehaviorTreeDocument is where the snapshots become undo entries.

⚠ A node's identity is the object. Nothing carries a GUID: the content tree is reachable only through this model, a snapshot restore replaces the whole tree at once, and a selection is re-resolved from the path after one. An id would be a second thing the file has to carry and a person editing the YAML has to keep unique.

Fields and properties (3)

Events (1)

Methods (31)

Used by (7)

  • BehaviorTreeDocumentVixen.Editor.AssetEditors
  • BehaviorTreeDocumentTestsVixen.Editor.AssetEditors.Tests
  • BehaviorTreeLayoutVixen.Editor.Ai
  • BehaviorTreeModelTestsVixen.Editor.Ai.Tests
  • BehaviorTreeProjectionVixen.Editor.Ai
  • BehaviorTreeViewVixen.Editor.AssetEditors
  • SnapshotCommandVixen.Editor.AssetEditors