Getting Started
Prerequisites
To start develop on SwiftlyS2, you will need the following prerequisites:
- .NET 10.0 SDK
Install package
After you have installed the .NET 10.0 SDK and ensure that dotnet command is in your PATH, you can install the SwiftlyS2 package using the following command:
dotnet new install SwiftlyS2.CS2.PluginTemplate
Create a plugin from template
Use the following command to create a plugin from the template. Fill in the information as you want, and run the generated command.
dotnet new swplugin -n "TestPlugin" --PluginName "TestPlugin" --PluginAuthor "Anonymous" --PluginVersion "1.0.0"
After it's properly generated, the folder structure should looks like this:
Update version
The package version in template might not be the latest version. Update the following line to update it.
<PackageReference Include="SwiftlyS2.CS2" Version="1.0.5" ExcludeAssets="runtime" />Publishing
Use the following command to build a publish version of the plugin.
dotnet publishIf it's built successfully, you will find the published package in build/publish directory.
You can directly copy the package to the SwiftlyS2's plugin directory for test, and use the .zip file for release.
Design pattern
Before you start writing your first line of code, we strongly recommend you to read the Dependency Injection guide.
Explore
To explore the API reference, you can check the examples folder in the template, which contains some examples of a few features.
You can also check the following pages for more detailed API documentation.