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
Choosing an IDE
We recommend Jetbrains' Rider. It's free if you have a student email, and once in a while an Early Access Program is available, which is also free.
Adding LAPI to your project
Adding the Nuget package
LAPI V2 and higher comes in a nuget package, found here: https://www.nuget.org/packages/LyokoAPI/ A nuget package insures that you can easily update LAPI and that all it's required components, like YamlDotNet, are also installed automatically
The method of adding a nuget package depends on your IDE. Here are some links to help you: Rider Visual studio
OBSOLETE: Referencing a class library
this approach is OBSOLTE since LAPI V2.0.0. Use the NUGET PACKAGE method instead
Adding a library (like LAPI) to your project is called referencing. referencing in Visual studio: https://www.webucator.com/how-to/how-add-references-your-visual-studio-project.cfm (the 'browse' section) Referencing in Unity: https://answers.unity.com/questions/458300/how-to-use-a-external-dll.html We recommend using the Early Access Program of [JetBrains' Rider](https://www.jetbrains.com/rider/eap/). 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 on the rules of writing a good plugin.
Main class
Only ONE class per plugin should extend LyokoAPIPlugin.
Last updated
Was this helpful?