using UnityEngine;
using XericLibrary.Runtime.Blueprint;
namespace XericLibrary.Runtime.Blueprint.Element
{
///
/// 图论测试节点 —— 用于图论蓝图测试的简单节点。
/// 包含一个输入端口和一个输出端口,节点颜色由外部指定。
///
public class GraphTheoryNode : BlueprintNode
{
private readonly string _title;
private readonly string _category;
public override string NodeTitle
{
get { return _title; }
}
public override string Category
{
get { return _category; }
}
///
/// 创建一个图论测试节点。
///
/// 节点标题
/// 节点边框颜色
public GraphTheoryNode(string title, Color color)
{
_title = title;
_category = "Test";
NodeColor = color;
NodeBGColor = new Color(0.15f, 0.15f, 0.15f, 1f);
NodeTextColor = Color.gray;
AddInputPort("In", "any");
AddOutputPort("Out", "any");
}
///
/// 创建一个带指定颜色的图论测试节点。
///
/// 节点标题
/// 节点边框颜色
/// 节点背景颜色
public GraphTheoryNode(string title, Color color, Color bgColor)
{
_title = title;
_category = "Test";
NodeColor = color;
NodeBGColor = bgColor;
NodeTextColor = Color.gray;
AddInputPort("In", "any");
AddOutputPort("Out", "any");
}
public override void Execute(BlueprintExecutionContext context)
{
// 测试节点,无执行逻辑
}
public override System.Collections.Generic.IReadOnlyList GetRequiredToolTypes()
{
return System.Array.Empty();
}
}
}