本文整理汇总了C++中UEdGraphNode::CreatePin方法的典型用法代码示例。如果您正苦于以下问题:C++ UEdGraphNode::CreatePin方法的具体用法?C++ UEdGraphNode::CreatePin怎么用?C++ UEdGraphNode::CreatePin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UEdGraphNode
的用法示例。
在下文中一共展示了UEdGraphNode::CreatePin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
UEdGraphPin* UK2Node_Tunnel::CreatePinFromUserDefinition(const TSharedPtr<FUserPinInfo> NewPinInfo)
{
// Create the new pin
EEdGraphPinDirection Direction = bCanHaveInputs ? EGPD_Input : EGPD_Output;
// Let the user pick the pin direction if legal
if ( (bCanHaveInputs && NewPinInfo->DesiredPinDirection == EGPD_Input) || (bCanHaveOutputs && NewPinInfo->DesiredPinDirection == EGPD_Output) )
{
Direction = NewPinInfo->DesiredPinDirection;
}
UEdGraphPin* Result = CreatePin(Direction, NewPinInfo->PinType, NewPinInfo->PinName);
Result->DefaultValue = Result->AutogeneratedDefaultValue = NewPinInfo->PinDefaultValue;
// Make sure it mirrors onto the associated node
UEdGraphNode* TargetNode = ((InputSinkNode != NULL) ? InputSinkNode : OutputSourceNode);
if (Cast<UK2Node_Composite>(TargetNode) != NULL || Cast<UK2Node_MacroInstance>(TargetNode) != NULL)
{
UEdGraphPin* HasPinAlready = TargetNode->FindPin(Result->PinName);
if (HasPinAlready == NULL)
{
TargetNode->CreatePin(UEdGraphPin::GetComplementaryDirection(Direction), NewPinInfo->PinType, NewPinInfo->PinName);
}
}
else if (UK2Node_Tunnel* TunnelNode = Cast<UK2Node_Tunnel>(TargetNode))
{
TunnelNode->CreateUserDefinedPin(NewPinInfo->PinName, NewPinInfo->PinType, (Direction == EGPD_Input)? EGPD_Output : EGPD_Input);
}
//@TODO: Automatically update loaded macro instances when this node is changed too
return Result;
}