Project02/ProjectFish/Plugins/Dialogue/Source/DialogueEditor/Private/DialogueGraphPanelNodeFactory.cpp

25 lines
839 B
C++
Raw Normal View History

2025-11-17 15:11:34 +08:00
// 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"
2025-11-18 15:37:21 +08:00
#include "Node/DialogueGraphNode_Root.h"
2025-11-17 15:11:34 +08:00
#include "Widget/DialogueGraphNode.h"
2025-11-18 15:37:21 +08:00
#include "Widget/GraphNodeWidget_Root.h"
2025-11-17 15:11:34 +08:00
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);
2025-11-18 15:37:21 +08:00
if (UDialogueGraphNode_Root* RootNode = Cast<UDialogueGraphNode_Root>(InNode))
return SNew(SGraphNodeWidget_Root, RootNode);
2025-11-17 15:11:34 +08:00
return nullptr;
}