插入 更新 添加 移除 复制 重置 。 UCLASS(Abstract, MinimalAPI) class USplineMetadata : public UObject { GENERATED_UCLASS_BODY() public: /** Insert point before index, lerpingbetween previous and next key values */ ENGINE_API virtual void InsertPoint(int32 Index, float t, bool bClosedLoop) ...
#include "UObject/Object.h" #include "MyCustomSetting.generated.h" UCLASS() class MYDEMO_API UMyCustomSetting : public UObject { GENERATED_BODY() public: UPROPERTY(EditAnywhere, Category = Setting1) bool UseCustomSetting; UPROPERTY(EditAnywhere, Category = Setting2, meta=(UIMin=1,EditCondition...
使用UCLASS([specifiers])暴露类至蓝图,其中的specifiers在暴露类的时候并不常用,并在第一行使用GENERATED_BODY(),添加头文件#include "XXX.generated.h",如: #include "GameFramework/Actor.h" #include "MyActor.generated.h" UCLASS() class AMyActor : public AActor { GENERATED_BODY() public: // 设置...
UCLASS(BlueprintType)// 标记这是一个可以用于蓝图的Unreal Engine类。classPAPER2D_APIUPaperTileMap:publicUObject// 纸张瓦片图类,继承自UObject。{GENERATED_UCLASS_BODY()// 宏,用于帮助Unreal Engine生成类体。// 地图宽度(单位为瓦片)UPROPERTY(Category=Setup,EditAnywhere,BlueprintReadOnly,meta=(UIMin=1...
UCLASS宏,使虚幻4能识别UMyObject classMYPROJECT_APIUMyObject:publicUObject 类名_API 如MyProject希望将UMyObject类公开到其他模块,则需要指定MYPROJECT_API GENERATED_BODY() GENERATED_BODY宏不获取参数,但会对类进行设置,以支持引擎要求的基础结构,GENERATED_BODY宏将成员访问等级设为"public",而非设置"private"...
可以从蓝图函数库中拖拽自定义函数节点,并将其插入到蓝图逻辑中。 UCLASS()classCOMMONGAME_APIUCommonUIExtensions:publicUBlueprintFunctionLibrary{GENERATED_BODY()public:UCommonUIExtensions(){}UFUNCTION(BlueprintPure,BlueprintCosmetic,Category="Global UI Extensions",meta=(WorldContext="WidgetContextObject"))stat...
默认的 Scene Capture 不能用于实时Lumen光照模式下 为了实现实时渲染GI下,类似于UCanvasRenderTarget2D类,捕获指定位置摄像头的场景像素. 可以参考GameViewport类的源码尝试使用UE的渲染逻辑和数据多渲染一份视口副本到新创建的FSceneView上,封装一份UCaptureRenderTarget出来 ...
1.添加静态成员函数 UCLASS()classMYPROJECT2_APIUAssetImportLibrary:publicUBlueprintFunctionLibrary{GENERATED_BODY()public:UFUNCTION(BlueprintCallable,Category="Asset Importer")staticvoidImportMeshAsset(constFString FileName,TArray<FModelData>&ExtractedModelData);}; ...
用UHT分析生成generated.h/.cpp文件,之后再一起编译。 generated.h/.cpp文件中对宏展开 UCLASS()classUTestObject:publicUObject{GENERATED_BODY()public:UPROPERTY(BlueprintReadWrite,Category="Test")FString CurPlayerName;UPROPERTY(BlueprintReadWrite,Category="Test")int32 CurPlayerAge;UFUNCTION(BlueprintCallable...
AActor 的子类,并且你想在服务器上运行一个函数。在头文件中声明服务器端函数:// YourActor.h #pragma once #include "CoreMinimal.h"#include "GameFramework/Actor.h"#include "YourActor.generated.h"UCLASS()class YOURGAME_API AYourActor : public AActor { GENERATED_BODY()1/ 5 ...