/// <summary> /// Make sure our list of PortViews and editables sync up with our NodePorts /// </summary> protected void UpdatePorts() { foreach (var port in target.ports) { if (port.isInput) { AddInputPort(port); } else { AddOutputPort(port); } } // TODO: Support FuncNode since GetNodeType won't work for those // as they're registered under a different type. var reflectionData = NodeReflection.GetNodeType(target.GetType()); if (reflectionData != null) { foreach (var editable in reflectionData.editables) { AddEditableField(m_SerializedNode.FindProperty(editable.fieldName)); } } // Toggle visibility of the extension container RefreshExpandedState(); // Update state classes EnableInClassList("hasInputs", inputs.Count > 0); EnableInClassList("hasOutputs", outputs.Count > 0); }
protected void OnTooltip(TooltipEvent evt) { // TODO: Better implementation that can be styled if (evt.target == titleContainer.Q("title-label")) { var typeData = NodeReflection.GetNodeType(target.GetType()); evt.tooltip = typeData?.tooltip; // Float the tooltip above the node title bar var bound = titleContainer.worldBound; bound.x = 0; bound.y = 0; bound.height *= -1; evt.rect = titleContainer.LocalToWorld(bound); } }