diff --git a/Scripts/Node.cs b/Scripts/Node.cs index 8e1a670..6744cc5 100644 --- a/Scripts/Node.cs +++ b/Scripts/Node.cs @@ -314,6 +314,7 @@ namespace XNode { public OutputAttribute(ShowBackingValue backingValue, ConnectionType connectionType, bool dynamicPortList) : this(backingValue, connectionType, TypeConstraint.None, dynamicPortList) { } } + /// Manually supply node class with a context menu path [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] public class CreateNodeMenuAttribute : Attribute { public string menuName; @@ -334,16 +335,20 @@ namespace XNode { } } + /// Prevents Node of the same type to be added more than once (configurable) to a NodeGraph [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] public class DisallowMultipleNodesAttribute : Attribute { + // TODO: Make inheritance work in such a way that applying [DisallowMultipleNodes(1)] to type NodeBar : Node + // while type NodeFoo : NodeBar exists, will let you add *either one* of these nodes, but not both. public int max; - /// Prevents Node of the same type (or subtype) to be added more than once (configurable) to a NodeGraph + /// Prevents Node of the same type to be added more than once (configurable) to a NodeGraph /// How many nodes to allow. Defaults to 1. public DisallowMultipleNodesAttribute(int max = 1) { this.max = max; } } + /// Specify a color for this node type [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] public class NodeTintAttribute : Attribute { public Color color; @@ -370,6 +375,7 @@ namespace XNode { } } + /// Specify a width for this node type [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)] public class NodeWidthAttribute : Attribute { public int width;