Use plugins to extend Makinom’s functionality.
Plugins can be used to add content and store custom settings in the Makinom project asset without changing the source code of Makinom. They also contain functions that will automatically be called by Makinom, e.g. when Makinom is initialized, starts a new game or loads a game.
Once a plugin’s code is in your Unity project, you can use it in Makinom by adding and selecting the plugin in Editor > Plugins.
When you want to remove a plugin, make sure to first remove it in the Makinom editor before removing the plugin’s code (and save the changes).
Creating Custom Plugins #
Create custom plugins by deriving from the BasePlugin class (namespace GamingIsLove.Makinom) and implementing all the required abstract functions and properties. See below for a sample plugin integration.
Make sure to use an EditorSettingInfo attribute for the class to define the name and description of your plugin, as this information is used by the selection popup in the Makinom editor to select your plugin.
Sample Plugin #
Use the sample plugin as a basis for your custom plugin – just remove the settings and add your own as needed. You should also either use a different namespace or rename the SamplePlugin class to a different name, as well as change the EditorSettingsInfo attribute’s content.
You can download a sample plugin implementation here.
Plugin Code #
See the the bare minimum of a plugin’s code below. This is basically the sample plugin without any settings.
using UnityEngine; using System.Collections.Generic; // INFO: Add plugins in 'Editor > Plugins' in the Makinom editor. namespace GamingIsLove.Makinom.Plugins { /* INFO: The settings available in 'Editor > Plugins' in the Makinom editor must be placed in this class (or sub-classes implementing the 'IBaseData' interface or extending from 'BaseData'). The 'EditorSettingsInfo' attribute defines the name and description of the plugin in the selection popup. */ [EditorSettingInfo("Sampe Plugin", "A sample plugin.")] public class SamplePlugin : BasePlugin { public SamplePlugin() { } // INFO: This is used to display the plugin's version in the editor. public override string Version { get { return "1.0.0"; } } /* ============================================================================ Makinom callback functions ============================================================================ */ public override void OnInitialize() { // INFO: Called when Makinom is initialized. } public override void OnNewGame() { // INFO: Called when starting a new game. } public override void OnLoadGame() { // INFO: Called when loading a saved game. } public override void Tick() { // INFO: Optionally called on each Update tick. } public override void GUITick() { // INFO: Optionally called on each GUI update tick. } public override void SceneLoaded() { // INFO: Optionally called on each scene load. } public override void SceneNameLoaded(string sceneName) { // INFO: Optionally called on each scene load, forwarding the name of the loaded scene. } public override bool Call(string info) { // INFO: Called from 'Call Plugin' schematic nodes. // Use the info string to pass information about the call to do different things. return false; } } }
Extension Manager #
The extension manager can be used to browse, download and import available extensions (e.g. plugins, custom nodes, other scripts or schematics) for Makinom.
Open it using the Unity Menu: Window > Makinom Extension Manager
Make sure to save your open Makinom project or schematics (in the Makinom editor) before importing any package, as importing a package will reset all unsaved changes.