Using Plugins
Enabling Plugins
For this reason plugin execution is disabled by default for every project. Enable plugins in
Views > Plugins by checking “Enable plugins for this project”.
Only enable plugins for projects you trust. If you move or rename your project, you will need to re-enable plugins.
Installing Plugins
There are two ways to install plugins: via your project dependencies or as files in the plugins folder.
After installation, open Views > Plugins to enable/disable them per project.
Via NPM
You can install plugins via the node package manager (NPM). Install a plugin with the following command:
1npm i --save-dev @wonderlandengine/not-a-real-pluginReplace @wonderlandengine/not-a-real-plugin with any plugin you want to install.
Running this command will create a new entry in the devDependencies section of your package.json file.
The plugin will then appear in the Plugins view.
Managing Plugins
Sometimes you want to disable plugins to reduce UI clutter or to restore editor performance.
Open Views > Plugins to see all available plugins and manage them:
- Enable plugins for the current project via the checkbox at the top “Enable plugins for this project”.
- Use the tabs to switch between “Editor Scope” (plugins that extend the editor itself) and
“Project Scope” (plugins installed by your project via
devDependenciesor theplugins/folder). - Toggle individual plugins on/off via the checkboxes. Changes take effect immediately; some plugins may ask you to reload the project.
Development
Creating plugins is easy. You have three methods available:
Plugin Script
A single script that can share dependencies with your main project package.json.
We recommend you install any plugin-related dependencies as devDependencies (using --save-dev).
You can create a new plugin by creating the plugins folder in your project’s root, then
right-click > New Plugin.
Make sure to install the @wonderlandengine/editor-api package in your project root:
1npm i --save-dev @wonderlandengine/editor-apiPlugin Directory
Similarly to Plugin Scripts, create a plugins subfolder first,
but then create yet another subfolder that you name according to your plugin.
In this folder you can create a new package.json file (e.g. via npm init).
Make sure to install the @wonderlandengine/editor-api package in that directory:
1npm i --save @wonderlandengine/editor-apiNote, --save instead of --save-dev, as you are not installing into your Wonderland Engine
project, but into a separate plugin project.
Plugin Package
If you want to share and distribute your plugin, you can npm init in a separate folder, and add
the "wonderlandengine" key to your package.json.
Make sure to install the @wonderlandengine/editor-api package in that directory:
1npm i --save @wonderlandengine/editor-apiTo use this local plugin in your project, npm i --save-dev <path-to-the-directory>,
or publish it when ready and install it via the package, see Installing.