UE C++ 编辑器开发 2.蓝图节点右键菜单,蓝图连线类型

1.蓝图节点右键菜单

//蓝图节点右键菜单
	virtual void GetContextMenuActions(class UToolMenu* Menu, class UGraphNodeContextMenuContext* Context) const;

2.蓝图节点连线

//蓝图节点连线
	virtual const FPinConnectionResponse CanCreateConnection(const UEdGraphPin* A, const UEdGraphPin* B) const
	{
        //参数1为连接的类型,是一个枚举
		return FPinConnectionResponse(CONNECT_RESPONSE_DISALLOW, TEXT("Not implemented by this schema"));
	}


 节点连线的连接枚举类型源码

UENUM()
enum ECanCreateConnectionResponse
{
	/** 建立连接; there are no issues (message string is displayed if not empty). */
	CONNECT_RESPONSE_MAKE,

	/** 无法建立连接; display the message string as an error. */
	CONNECT_RESPONSE_DISALLOW,

	/** 断开所有A上面的连接,并重新连接 (it's exclusive); display the message string as a warning/notice. */
	CONNECT_RESPONSE_BREAK_OTHERS_A,

	/** 断开所有B上面的连接,并重新连接 (it's exclusive); display the message string as a warning/notice. */
	CONNECT_RESPONSE_BREAK_OTHERS_B,

	/** 断开所有A、B上面的连接,并重新连接(it's exclusive); display the message string as a warning/notice. */
	CONNECT_RESPONSE_BREAK_OTHERS_AB,

	/** 通过中间转换节点建立连接, 或者其他转换节点. */
	CONNECT_RESPONSE_MAKE_WITH_CONVERSION_NODE,

	CONNECT_RESPONSE_MAX,
};

猜你喜欢

转载自blog.csdn.net/weixin_45500363/article/details/123388163
今日推荐