0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【UE5】EnumをC++で作成する方法メモ

Posted at

タイトル通りです。
EnumはC++で宣言しないとC++で使えないということで、やり方を自分用にメモしました。

Enum宣言用のクラス作成

Noneで作成する。

image.png

C++実装

そもそも.cppはいらないので消す。
ヘッダーファイル(.h)でEnumを宣言する

EnumDeclaration.h
#pragma once

#include "CoreMinimal.h"
#include "EnumDeclaration.generated.h"

UENUM(BlueprintType)
enum class EMyEnum : uint8
{
    // 追加した列挙子
    Default = 0     UMETA(DisplayName = "Default"),
    Orange = 1    UMETA(DisplayName = "Orange"),
    Peach = 2     UMETA(DisplayName = "Peach"),
};

UEエディターを閉じてフルビルドして終わり。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?