| 1045 | } |
| 1046 | |
| 1047 | void UFlowNode::TriggerOutput(const FName PinName, const bool bFinish /*= false*/, const EFlowPinActivationType ActivationType /*= Default*/) |
| 1048 | { |
| 1049 | if (HasFinished()) |
| 1050 | { |
| 1051 | // do not trigger output if node is already finished or aborted |
| 1052 | LogError(TEXT("Trying to TriggerOutput after finished or aborted"), EFlowOnScreenMessageType::Disabled); |
| 1053 | return; |
| 1054 | } |
| 1055 | |
| 1056 | // clean up node, if needed |
| 1057 | if (bFinish) |
| 1058 | { |
| 1059 | Finish(); |
| 1060 | } |
| 1061 | |
| 1062 | #if !UE_BUILD_SHIPPING |
| 1063 | if (OutputPins.Contains(PinName)) |
| 1064 | { |
| 1065 | // record for debugging, even if nothing is connected to this pin |
| 1066 | TArray<FPinRecord>& Records = OutputRecords.FindOrAdd(PinName); |
| 1067 | Records.Add(FPinRecord(FApp::GetCurrentTime(), ActivationType)); |
| 1068 | |
| 1069 | if (const UFlowAsset* FlowAssetTemplate = GetFlowAsset()->GetTemplateAsset()) |
| 1070 | { |
| 1071 | FlowAssetTemplate->OnPinTriggered.ExecuteIfBound(this, PinName); |
| 1072 | } |
| 1073 | } |
| 1074 | else |
| 1075 | { |
| 1076 | LogError(FString::Printf(TEXT("Output Pin name %s invalid"), *PinName.ToString())); |
| 1077 | } |
| 1078 | #endif |
| 1079 | |
| 1080 | // call the next node |
| 1081 | if (OutputPins.Contains(PinName) && Connections.Contains(PinName)) |
| 1082 | { |
| 1083 | const FConnectedPin FlowPin = GetConnection(PinName); |
| 1084 | GetFlowAsset()->TriggerInput(FlowPin.NodeGuid, FlowPin.PinName, FConnectedPin(GetGuid(), PinName)); |
| 1085 | } |
| 1086 | } |
| 1087 | |
| 1088 | void UFlowNode::Finish() |
| 1089 | { |
no test coverage detected