1. 创建
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. 在蓝图里的应用