C/C++ / UE · 2024年11月23日 0

UE C++ 写的变量开放到蓝图的构造函数、新建类 、SpawnActor

主要标签 meta=(ExposeOnSpawn=”true”)

案例:

USTRUCT(BlueprintType)
struct FDTGisDomSource
{
	GENERATED_BODY()
	UPROPERTY(BlueprintReadWrite) FString						Name;
	UPROPERTY(BlueprintReadWrite) FString						Link;
	UPROPERTY(BlueprintReadWrite) int							LevelMin = 0;
	UPROPERTY(BlueprintReadWrite) int							LevelMax = 22;
	UPROPERTY(BlueprintReadWrite) int							LevelDefault = 15;
};

UCLASS(BlueprintType)
class UDTGisDomSourceListObject : public UObject
{
	GENERATED_BODY()

public:
	UPROPERTY(EditAnywhere, BlueprintReadWrite, meta=(ExposeOnSpawn="true") )
	FDTGisDomSource												GisDomSource;
};
UE C++ 写的变量开放到蓝图的构造函数、新建类 、SpawnActor