mirror of
https://github.com/Siccity/xNode.git
synced 2026-02-14 02:58:45 +08:00
Improved NodeEnumDrawer serialization
This commit is contained in:
parent
b08d706e0d
commit
d397e3a208
@ -1,4 +1,5 @@
|
|||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
/// <summary> Draw enums correctly within nodes. Without it, enums show up at the wrong positions. </summary>
|
/// <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 { }
|
public class NodeEnumAttribute : PropertyAttribute { }
|
||||||
@ -51,6 +51,7 @@ namespace XNodeEditor {
|
|||||||
private void SetEnum(SerializedProperty property, int index) {
|
private void SetEnum(SerializedProperty property, int index) {
|
||||||
property.enumValueIndex = index;
|
property.enumValueIndex = index;
|
||||||
property.serializedObject.ApplyModifiedProperties();
|
property.serializedObject.ApplyModifiedProperties();
|
||||||
|
property.serializedObject.Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user