1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-21 01:36:03 +08:00

compatibility patches, make xNode work on Unity 5.4.

This commit is contained in:
neko1990 2017-12-03 23:50:54 +08:00
parent d7e133a822
commit ec4429e969
3 changed files with 4 additions and 2 deletions

View File

@ -55,7 +55,7 @@ namespace XNodeEditor {
[AttributeUsage(AttributeTargets.Class)] [AttributeUsage(AttributeTargets.Class)]
public class CustomNodeEditorAttribute : Attribute, public class CustomNodeEditorAttribute : Attribute,
INodeEditorAttrib { XNodeInternal.NodeEditorBase<NodeEditor, NodeEditor.CustomNodeEditorAttribute, XNode.Node>.INodeEditorAttrib {
private Type inspectedType; private Type inspectedType;
/// <summary> Tells a NodeEditor which Node type it is an editor for </summary> /// <summary> Tells a NodeEditor which Node type it is an editor for </summary>
/// <param name="inspectedType">Type that this editor can edit</param> /// <param name="inspectedType">Type that this editor can edit</param>

View File

@ -72,8 +72,10 @@ namespace XNodeEditor {
kvp.Add(new KeyValuePair<ContextMenu, MethodInfo>(attribs[k], methods[i])); kvp.Add(new KeyValuePair<ContextMenu, MethodInfo>(attribs[k], methods[i]));
} }
} }
#if UNITY_5_5_OR_NEWER
//Sort menu items //Sort menu items
kvp.Sort((x, y) => x.Key.priority.CompareTo(y.Key.priority)); kvp.Sort((x, y) => x.Key.priority.CompareTo(y.Key.priority));
#endif
return kvp.ToArray(); return kvp.ToArray();
} }

View File

@ -36,7 +36,7 @@ namespace XNodeEditor {
[AttributeUsage(AttributeTargets.Class)] [AttributeUsage(AttributeTargets.Class)]
public class CustomNodeGraphEditorAttribute : Attribute, public class CustomNodeGraphEditorAttribute : Attribute,
INodeEditorAttrib { XNodeInternal.NodeEditorBase<NodeGraphEditor, NodeGraphEditor.CustomNodeGraphEditorAttribute, XNode.NodeGraph>.INodeEditorAttrib {
private Type inspectedType; private Type inspectedType;
/// <summary> Tells a NodeEditor which Node type it is an editor for </summary> /// <summary> Tells a NodeEditor which Node type it is an editor for </summary>
/// <param name="inspectedType">Type that this editor can edit</param> /// <param name="inspectedType">Type that this editor can edit</param>