标签:async let 多播 min rem context copy ble other
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintAsyncActionBase.h"
#include "MyBlueprintAsyncActionBase.generated.h"
/*
* 这是申明的多播 也就是异步节点的输出引脚
*/
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDoComplete, FString, Key);
/**
* 创建节点需要继承 UBlueprintAsyncActionBase
*/
UCLASS()
class MYNULL_1_API UMyBlueprintAsyncActionBase : public UBlueprintAsyncActionBase
{
GENERATED_BODY()
public:
UMyBlueprintAsyncActionBase();
UPROPERTY(BlueprintAssignable)
FDoComplete DoComplete;
public:
/*
* BlueprintInternalUseOnly 只允许蓝图使用 蓝图调用的函数必须时静态的 不知道为什么
*/
UFUNCTION(BlueprintCallable, Category = "MyThings", meta = (BlueprintInternalUseOnly = "true", WorldContext = "WorldContextObject"))
static UMyBlueprintAsyncActionBase* DoThing(const FString Str);
/*
// Fill out your copyright notice in the Description page of Project Settings.
#include "MyBlueprintAsyncActionBase.h"
UMyBlueprintAsyncActionBase::UMyBlueprintAsyncActionBase()
{
}
UMyBlueprintAsyncActionBase* UMyBlueprintAsyncActionBase::DoThing(const FString Str)
{
UMyBlueprintAsyncActionBase* BlueprintNode = NewObject<UMyBlueprintAsyncActionBase>();
BlueprintNode->DoOther(Str,BlueprintNode);
return BlueprintNode;
}
void UMyBlueprintAsyncActionBase::DoOther(const FString Str, UMyBlueprintAsyncActionBase* Async)
{
UE_LOG(LogTemp, Log, TEXT("AAA"));
Async->DoComplete.Broadcast(Str);
}
* 这是主要的函数 */ void DoOther(const FString Str, UMyBlueprintAsyncActionBase* Async); };
标签:async let 多播 min rem context copy ble other
原文地址:https://www.cnblogs.com/djw1993/p/12942371.html