1
0
mirror of https://github.com/Siccity/xNode.git synced 2025-12-20 17:26:02 +08:00
xNode/Scripts/Editor/Interfaces/INodeEditor.cs
Thor Brigsted aeeeb74290 WIP
2019-07-24 14:37:51 +02:00

30 lines
916 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using XNode;
namespace XNodeEditor {
public interface INodeEditor {
Editor editor { get; }
void OnBodyGUI();
void OnHeaderGUI();
/// <summary> Add items for the context menu when right-clicking this node. Override to add custom menu items. </summary>
void AddContextMenuItems(GenericMenu menu);
}
[AttributeUsage(AttributeTargets.Class)]
public class CustomNodeEditorAttribute : Attribute, XNodeEditor.Internal.INodeEditorAttrib {
private Type inspectedType;
/// <summary> Tells a NodeEditor which Node type it is an editor for </summary>
/// <param name="inspectedType">Type that this editor can edit</param>
public CustomNodeEditorAttribute(Type inspectedType) {
this.inspectedType = inspectedType;
}
public Type GetInspectedType() {
return inspectedType;
}
}
}