Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


INodeView

The generated view for a Node, exposed to NodeView<T> implementations so they can add custom UI to the node.
Read time 1 minuteLast updated 7 days ago

Definition

public interface INodeView

Remarks

Allocate custom UI in NodeView<T>.OnViewBuilt and add it to INodeView.Root. The contents of INodeView.Root are cleared whenever the node returns from being culled, so cache your custom elements in fields and re-add them from NodeView<T>.OnCullingChanged (when
cullingEnabled
is false).
Additional Resources: NodeView<T>, NodeView<T>.OnViewBuilt

Examples

class MyNodeView : NodeView<MyNode>{ Label m_Label; public override void OnViewBuilt() { m_Label = new Label($"Node: {Node.Title}"); View.Root.Add(m_Label); } public override void OnCullingChanged(bool cullingEnabled) { if (!cullingEnabled && m_Label != null) View.Root.Add(m_Label); }}

Properties

Property

Description

RootThe root VisualElement of the node, to which custom UI can be added.