Plugins can be used to integrate 3rd party products or extend ORK’s features.
Plugins are found in Editor > Plugins.
Plugins can be used to add content and store custom settings in the ORK project asset without changing the source code. They also contain functions that will automatically be called by ORK, e.g. when ORK 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 ORK by adding and selecting the plugin.
When you want to remove a plugin, make sure to first remove it in the ORK 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.ORKFramework) 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 ORK editor to select your plugin.
Plugin Code #
See the the bare minimum of a plugin’s code below.
// INFO: Add plugins in 'Editor > Plugins' in the ORK editor.
namespace GamingIsLove.ORKFramework.Plugins
{
/* INFO:
The settings available in 'Editor > Plugins' in the ORK 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"; }
}
/*
============================================================================
ORK callback functions
============================================================================
*/
public override void OnInitialize()
{
// INFO: Called when ORK 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;
}
}
}

