LoginSignup
1
2

More than 1 year has passed since last update.

UE4,5 C++でEditor Utility Widgetを作る。

Last updated at Posted at 2022-12-20

1. Editor Moduleを作る(Riderの場合)

Sourceフォルダ右クリック > Add > Unreal Module

image.png

New Unreal Module

  • Module Name: 適当な名前
  • Module Type: Editor
  • Loading Phase: PosEngineInit
    image.png

2. Module名.Build.csの編集

PrivateDependencyModuleNames.AddRangeに"UMG"を追加。

Source内の他のモジュールを使う場合はそれも追加。(今回の例だとListView_CPP)

MyGameEditor.Build.cs
        PrivateDependencyModuleNames.AddRange(
            new string[]
            {
                "CoreUObject",
                "Engine",
                "Slate",
                "SlateCore",
                "UMG", 
                "ListView_CPP"
            }
        );

2. EditorUtilityWidgetの派生C++クラスの作成

Content Browser右クリック > New C++ Class > EditorUtilityWidget

image.png

Nameはお好きなように。その右のDropDownリストで先ほど作ったEditorModule(この例ではMyGameEditor(Editor))を選択。

image.png
image.png

ここ超重要
必ずEditorModuleを選択すること

作成したクラスを適当に実装

3. EditorUtilityWidgetを作成し、その親に先ほど作ったC++クラスを指定する。

Content Browser右クリック > Editor Utilities > Editor Utility Widgetで作成

image.png

作成したWidgetを開いて、File > Reparent Blueprintを選択

image.png

前項で作成したC++のEditorUtilityWidget派生クラスを選択。(今回の場合MyGameEditor_UtilityWidget)

image.png

これでこのEditorUtilityWidgetが作成したC++のサブクラスになります

image.png

ちゃんと右クリック > Run Editor Utility Widgetで起動できる。

image.png

1
2
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
1
2