mirror of
https://github.com/Siccity/xNode.git
synced 2025-12-20 17:26:02 +08:00
chore: cover NodeEnum and PortTypeOverrideAttribute with XNode namespace
This commit is contained in:
parent
a8ef96ce1b
commit
d41a887111
@ -1,5 +1,7 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
/// <summary> Draw enums correctly within nodes. Without it, enums show up at the wrong positions. </summary>
|
namespace XNode {
|
||||||
/// <remarks> Enums with this attribute are not detected by EditorGui.ChangeCheck due to waiting before executing </remarks>
|
/// <summary> Draw enums correctly within nodes. Without it, enums show up at the wrong positions. </summary>
|
||||||
public class NodeEnumAttribute : PropertyAttribute { }
|
/// <remarks> Enums with this attribute are not detected by EditorGui.ChangeCheck due to waiting before executing </remarks>
|
||||||
|
public class NodeEnumAttribute : PropertyAttribute { }
|
||||||
|
}
|
||||||
@ -1,12 +1,17 @@
|
|||||||
using System;
|
using System;
|
||||||
/// <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>
|
namespace XNode {
|
||||||
[AttributeUsage(AttributeTargets.Field)]
|
/// <summary> Overrides the ValueType of the Port, to have a ValueType different from the type of its serializable field </summary>
|
||||||
public class PortTypeOverrideAttribute : Attribute {
|
/// <remarks> Especially useful in Dynamic Port Lists to create Value-Port Pairs with different type. </remarks>
|
||||||
public Type type;
|
[AttributeUsage(AttributeTargets.Field)]
|
||||||
/// <summary> Overrides the ValueType of the Port </summary>
|
public class PortTypeOverrideAttribute : Attribute
|
||||||
/// <param name="type">ValueType of the Port</param>
|
{
|
||||||
public PortTypeOverrideAttribute(Type type) {
|
public Type type;
|
||||||
this.type = type;
|
/// <summary> Overrides the ValueType of the Port </summary>
|
||||||
|
/// <param name="type">ValueType of the Port</param>
|
||||||
|
public PortTypeOverrideAttribute(Type type)
|
||||||
|
{
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user