Project02/ProjectFish/Plugins/Dialogue/Source/DialogueEditor/Private/DialogueGraphPanelNodeFactory.cpp
2025-11-18 15:37:21 +08:00

25 lines
839 B
C++

// Fill out your copyright notice in the Description page of Project Settings.
#include "DialogueGraphPanelNodeFactory.h"
#include "Node//DialogueGraphNode_NPC.h"
#include "Node/DialogueGraphNode_Player.h"
#include "Node/DialogueGraphNode_Root.h"
#include "Widget/DialogueGraphNode.h"
#include "Widget/GraphNodeWidget_Root.h"
TSharedPtr<SGraphNode> FDialogueGraphPanelNodeFactory::CreateNode(class UEdGraphNode* InNode) const
{
if (UDialogueGraphNode_NPC* NPCNode = Cast<UDialogueGraphNode_NPC>(InNode))
return SNew(SDialogueGraphNode, NPCNode);
if (UDialogueGraphNode_Player* PlayerNode = Cast<UDialogueGraphNode_Player>(InNode))
return SNew(SDialogueGraphNode, PlayerNode);
if (UDialogueGraphNode_Root* RootNode = Cast<UDialogueGraphNode_Root>(InNode))
return SNew(SGraphNodeWidget_Root, RootNode);
return nullptr;
}