Setup #
For creating a plugin, you’ll need to create your own Dynamic Linked Library (DLL). It should be a C# .NET Framework library, with dependencies for Unity Engine and World Builder Plugin Core.
You’ll find the Unity Engine dlls in the sub folder of the World Builder installation path: “[INSTALL_PATH]\World Builder\World Builder_Data\Managed”
You’ll find a dll with the name “com.nuro.world-builder.plugin-core.dll”, this dll is the Plugin Core library for the World Builder. It includes all the interfaces and classes that you’ll need to integrate your plugin into the World Builder ecosystem.
After your setup for development is done, you can start with development. A World Builder Plugin always derives from PluginBase plus all the Plugin interfaces that you want to implement. One dll may contain multiple plugins.
Example #
using System;
using UnityEngine.UIElements;
using Nuro.Processes;
using WorldBuilder.Plugins;
namespace MY_PLUGIN_NAMESPACE
{
public class MyPlugin : PluginBase, IWizard, ILocalization
{
public override PluginFeatureFlags Features => PluginFeatureFlags.Wizard | PluginFeatureFlags.Localization;
public virtual string LocalizationFolderName => "My Plugin Localization";
public string WizardName => "My Plugin";
public string WizardDescription => "This is my new cool plugin for the World Builder";
public bool VisibleInWizardList => true;
public Process CreateRunProcess(VisualElement root, Action onCancel = null)
{
return new Process("My Plugin Run Process", null);
}
}
}
As you can see, we’re implementing two plugin interfaces, 1st IWizard for a wizard plugin and 2nd ILocalization for custom localization support of a plugin.
Plugins folder #
To integrate the plugin,, copy your dll-file into the sub folder of the World Builder: “[INSTALL_PATH]\World Builder\Plugins\External\[PLUGIN_NAME]\”
If you have localization csv-files, they should be in the LocalizationFolderName that you specified in the plugin. For the example above it would be: “[INSTALL_PATH]\World Builder\Plugins\External\MyPlugin\My Plugin Localization\”
Plugin types #
Even though there are more types of plugins available under PluginFeatureFlags, the most common ones you’ll be using are Wizard, Tool, AssetsProvider and Localization.