UENUM(BlueprintType) enum class EDamageType : uint8 { DT_Normal Umeta(DisplayName = "Normal"), DT_Fire Umeta(DisplayName = "Fire"), DT_Ice Umeta(DisplayName = "Ice"), }; UCLASS() class EXERCISE_API AENUMTEST : public AActor { GENERATED_BODY() public: // Sets default values for this actor's properties AENUMTEST(); protected: // Called when the game starts or when spawned virtual void BeginPlay() override; public: // Called every frame virtual void Tick(float DeltaTime) override; };
注意:
1. 结构体最好声明在继承了Actor的类里
2. Umeta(DisplayName)表示显示在蓝图里的名称
2. 在蓝图里的应用
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)