Skip to content

Instantly share code, notes, and snippets.

@dowmeister
Created October 28, 2020 12:48
Show Gist options
  • Save dowmeister/ddf8fca4d02b915f54396ae5e71d50f5 to your computer and use it in GitHub Desktop.
Save dowmeister/ddf8fca4d02b915f54396ae5e71d50f5 to your computer and use it in GitHub Desktop.
C# class
namespace overwolf.plugins
{
public class MyPlugin
{
public void myPluginFunction(string param1, string param2, Action<object> callback)
{
callback(new
{
status = "success"
});
}
}
}
Manifest.json:
"MyPlugin": {
"file": "plugins/OverwolfPlugin.dll",
"class": "overwolf.plugins.MyPlugin"
},
JS code:
overwolf.extensions.current.getExtraObject("MyPlugin", (result) => {
var _pluginInstance = result.object;
_pluginInstance.myPluginFunction("1", "2", (myPluginResult) => {
console.log(myPluginResult.status); // will be success
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment