Your First Plugin

Creating the plugin project

In order to make a plugin, create a new class library in your IDE (this should be easy to figure out using the GUI) The target framework must be compatible with .NET Framwork 3.5 (this is compatible with Unity) (example code can be found below)

Once you compile the project, you'll find it's dll file in a directory like bin/debug/ This is the file you can drop in the Plugins folder of the Application.

Understanding class libraries

LyokoAPI comes in the form of a class library. A class library is essentially a bunch of code that doesn't execute on it's own. Thus, it can't be used by itself. For C#, a library is compiled into a .dll file. Fun fact: Windows uses dll's as well for its own use! In theory, you can use the dll's in other .NET languages like VB.NET Your Plugin must also be a class library

Referencing a class library

Adding a library (like LAPI) to your project is called referencing. Referencing in Visual Studio (the 'browse' section) Referencing in Unity

We recommend using the Early Access Program of JetBrains' Rider. It's a renewable trial (lasts about a month), so it's essentially free.

To add a reference in Rider: (Right click project) -> add reference -> add from.. -> select LyokoAPI.dll

Writing your plugin

There are of course, many ways to write a plugin, but here is a 'template' that you can take inspiration from. See Plugin Introduction for more in-depth info.

Main class

Only ONE class per plugin should extend LyokoAPIPlugin.

Listener class

You dont need a seperate Listener class, but it looks clean and it's what we usually use internally.

Last updated

Was this helpful?