coolList = [];
+
+ public override void onEnable() {
+ // initializes the instance if it isn't already initialized
+ instance ??= this;
+ }
+}
+```
+
+```csharp
+public class CoolPluginAPI
+{
+ // guarantee an instance when the API is used
+ internal static CoolPlugin? getCoolPlugin() {
+ if (CoolPlugin.getInstance() == null) CoolPlugin.setInstance(new CoolPlugin());
+ return CoolPlugin.getInstance();
+ }
+
+ public static void CoolFunction(arg1, arg2, arg3) {
+ getCoolPlugin()?.coolList.Add(404);
+ }
+}
+```
+
### Fody Costura
Fody Costura isnt very well documented, but heres the general usage guide that has worked for users:
@@ -300,4 +373,4 @@ Fody Costura isnt very well documented, but heres the general usage guide that h
Build
After you've done all this, it should build and put all dependencies into one DLL in your output folder.
-
\ No newline at end of file
+