Graphs

com.cupkekgames.graphs — a generic graph-editing foundation for CupkekGames packages. Runtime abstractions for any graph-shaped ScriptableObject asset, plus a fully custom UI Toolkit canvas editor with no UnityEditor.Experimental.GraphView dependency (built directly on VisualElement, Painter2D, and manipulators).

It's the shared base under BehaviourTrees, StateMachines, and Luna's navigation graph — any feature that needs a node graph (dialogue, quests, ability composition, …) builds on it instead of reinventing a canvas.

Runtime abstractions

  • GraphAssetSO — base ScriptableObject for a graph asset; owns its nodes + connections, the editor working-copy clone/save flow, and Validate().
  • GraphNodeSO — a node with a stable Guid, typed input/output GraphPortDefs, and display metadata.
  • GraphConnection — an edge between two nodes' ports (by node guid + port id).
  • GraphPortDef — a port definition (id + direction) on a node.

Custom canvas editor

A complete UI Toolkit canvas — pan/zoom, multi-select, marquee, drag-to-connect (including drag-into-empty-space node creation), copy/paste, undo/redo, search-driven node creation, sticky notes, group regions, node collapse, [NodeGroup] field sections, a validation footer, and a play-mode runtime overlay.

Validation & repair

GraphConnectionValidation flags connections to deleted endpoint nodes or stale port ids and repairs the unambiguous cases (drop dead edges, remap single-port nodes); ambiguous cases stay flagged in the footer. The toolbar's Repair button runs it on the working copy. SubGraphValidation reports self-references and reference cycles, working-copy-aware via GraphAssetSO.EditorIdentity.

Asmdef + namespace

CupkekGames.Graphs (runtime) and CupkekGames.Graphs.Editor (editor).

Dependencies

  • com.cupkekgames.data (UPM — for SerializedGuid)
  • com.cupkekgames.editorui (UPM — editor widgets)

Repository

Cupkek-Games/CupkekGames-Graphs

Settings

Theme

Light

Contrast

Material

Dark

Dim

Material Dark

System

Sidebar(Light & Contrast only)

Light
Dark

Font Family

DM Sans

Wix

Inclusive Sans

AR One Sans

Direction

LTR
RTL