- Visual Studio Code to edit your plugins
- .NET Core SDK to compile your code (optional)
- .NET Framework 3.5 Targeting Pack (you might already have this)
- Virt-A-Mate to use your plugins
First of all, decide what your author name will be, and what your plugin name will be. From now on, replace Author and MyPlugin by your selected name. I suggest your keep those simple without any special characters.
- If you have a GitHub account (recommended), click on
Use this templateon the vam-plugin-template. It will create your own copy. You can also download this repository. - Clone (or unzip) this repo under
(VaM install path)\Custom\Scripts\Author\MyPlugin, replacingAuthorandMyPluginby yours, so that theMyPlugin.csis directly under theMyPluginfolder.
You should now be able to open the project in vscode by using File, Open Folder and select the MyPlugin folder.
- Rename the
MyPlugin.csandMyPlugin.csprojto match your plugin name. - Replace in files (ctrl + shift + h) all occurences of
AuthorandMyPluginby yours. - In
meta.json, fill in the description (keepv0.0.0if you plan on using GitHub Actions), credits, instructions and promotionalLink. You might also want to chage thelicenseType, if you wish. - Replace the content of
README.mdby your own content. - Replace the author name in LICENSE.md file to put your own name (it's all right, you have my blessing!)
The plugin is really a Unity MonoBehavior, which means you can use methods like Update, FixedUpdate, OnEnable, OnDisable and OnDestroy. Init however is called by Virt-A-Mate.
Keep in mind however that OnEnable will be called before Init.
You can run dotnet build in the plugin folder, and it'll show you any compilation errors. This is faster than going in VaM to do so! I recommend installing .NET 5 or more recent.
If you use GitHub, you can push a tag with the naming convention v0.0.0, and it will automatically create a release draft. You can then edit it (e.g. add a description) and publish it.
There are tons of references out there, you might want to look at GitHub Learning Lab. Learning Git is really worth your time.