To create a plugin, there is two way - 1. Create a new project and modify it to be a plugin type and add to existing one / 2. Download the example plugin and modify and same.
Unfortunately, both way are cumbersome to configure and not documented well.
Official document describes what needed to be done to work project as a plugin, but explanation is not thorough, the change item is too many and can easily missed.
As far as I figured out :
- Copy Plugin project to {Project Dir}\Plugins\
- Open projectās .flaxproj with a text editor and add Reference conf string refer to the template
- Open projectās {Project Dir}\Source\Game\Game.Build.cs with a text editor and add options.PrivateDependencies.Add string refer to the template class name you want to configure
- Go to {Project Dir}\Plugins{Plugin Name}\ and delete Game.Gen.cs
- Go to {Project Dir}\Plugins{Plugin Name}\ and rename Game(Editor)Target.Build.cs files into {Plugin Name}(Editor)Target.Build.cs.
- Go to {Project Dir}\Plugins{Plugin Name}\Game\ and delete Game.Build.cs
- Go to {Project Dir}\Plugins{Plugin Name}\ and rename directory āGameā into {Plugin Name}
- Open {Project Dir}\Plugins{Plugin Name}{Plugin Name}EditorTarget.Build.cs with a text editor and modify GameEditorTarget class declation into {Plugin Name}{Editor target class postfix name}
- Change string for Modules.Add(āGameā) into Modules.Add("{Plugin Name}") and add another line for editor module if you want to
- Open {Project Dir}\Plugins{Plugin Name}{Plugin Name}Target.Build.cs with a text editor and modify GameEditorTarget class declation into {Plugin Name}{target class postfix name}
- Change string for Modules.Add(āGameā) into Modules.Add("{Plugin Name}")
- Create your code inside plugin source
- Add _description fill code inside your GamePlugin class (C++) or create PluginDescription filled (C#) to be shown in Plugin window list (editor)
You can skip a few steps with Example Plugin repository, but still have to rename a lot of things manually by your hand.
As you see, the process just to ārename things to fit in the new name and un-standalonizeā is to much fragmented into pieces and easy to miss. It is possible, but currently it is in very handcrafting way.
Engine needs utility to automatically generate āplugin-typeā project and fill the class names, module names, file and directory names from the Plugin name.