Plugin ↔ Plugin

The following page describes how a plugin may interact with another plugin, e.g. calling functions.

Given that there are two plugins PluginA and PluginB , it is possible to call methods / access each other using the PluginManager.

A reference to the build *.dll of the other plugin is required in the solution, similiar to the HogWarpSdk.dll reference done in Configure the project.

circle-info

Make sure to only access another plugin earliest in the PostLoad lifecycle, as it is not guaranteed to be loaded if called earlier.

Example

PluginA.cs
namespace PluginA;

public class Plugin : HogWarpSdk.IPlugin
{
    public string Author { get; } = "YourName";
    public string Name { get; } = "PluginA";
    public Version Version { get; } = new(1, 0, 0, 0);
    
    public Plugin() { }

    public void PostLoad() { }

    public void Shutdown() { }
    
    public void DoSomething() 
    {
        // This method is called from a different plugin
    }
}

Last updated