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:
parent
a8ef96ce1b
commit
d41a887111
@ -1,5 +1,7 @@
|
||||
using UnityEngine;
|
||||
|
||||
/// <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 { }
|
||||
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 { }
|
||||
}
|
||||
@ -1,12 +1,17 @@
|
||||
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>
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
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) {
|
||||
this.type = type;
|
||||
|
||||
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 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