1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-20 09:16:01 +08:00

chore: cover NodeEnum and PortTypeOverrideAttribute with XNode namespace

This commit is contained in:
Ittipon Teerapruettikulchai 2025-03-03 02:28:43 +07:00
parent a8ef96ce1b
commit d41a887111
2 changed files with 20 additions and 13 deletions

View File

@ -1,5 +1,7 @@
using UnityEngine;
namespace XNode {
/// <summary> Draw enums correctly within nodes. Without it, enums show up at the wrong positions. </summary>
/// <remarks> Enums with this attribute are not detected by EditorGui.ChangeCheck due to waiting before executing </remarks>
public class NodeEnumAttribute : PropertyAttribute { }
}

View File

@ -1,12 +1,17 @@
using System;
namespace XNode {
/// <summary> Overrides the ValueType of the Port, to have a ValueType different from the type of its serializable field </summary>
/// <remarks> Especially useful in Dynamic Port Lists to create Value-Port Pairs with different type. </remarks>
[AttributeUsage(AttributeTargets.Field)]
public class PortTypeOverrideAttribute : Attribute {
public class PortTypeOverrideAttribute : Attribute
{
public Type type;
/// <summary> Overrides the ValueType of the Port </summary>
/// <param name="type">ValueType of the Port</param>
public PortTypeOverrideAttribute(Type type) {
public PortTypeOverrideAttribute(Type type)
{
this.type = type;
}
}
}