1+ ---
2+ id : unity-introduction
3+ title : Unity Introduction
4+ sidebar_label : Unity Introduction
5+ slug : /unity-plugin
6+ sidebar_position : 0
7+ ---
18<a href =" https://mod.io " ><img src =" https://mod.io/images/branding/modio-logo-bluedark.svg " alt =" mod.io " width =" 360 " align =" right " /></a >
29# mod.io Unity Plugin v2023.7.1
310[ ![ License] ( https://img.shields.io/badge/license-MIT-brightgreen.svg )] ( https://github.com/modio/modio-unity/blob/master/LICENSE )
@@ -62,7 +69,7 @@ below are a couple examples for some of the common usages of the plugin. Such as
6269All of the methods required to use the plugin can be found in ModIOUnity.cs. If you prefer using async methods over callbacks you can alternatively use ModIOUnityAsync.cs to use an async variation of the same methods.
6370
6471### Initialise the plugin
65- ``` c#
72+ ``` csharp
6673void Example ()
6774{
6875 Result result ModIOUnity .InitializeForUser (" ExampleUser" );
@@ -79,7 +86,7 @@ void Example()
7986```
8087
8188### Get the user's installed mods
82- ```c #
89+ ```csharp
8390void Example ()
8491{
8592 UserInstalledMod [] mods = ModIOUnity .GetInstalledModsForUser (out Result result );
@@ -93,7 +100,7 @@ void Example()
93100```
94101
95102### Enable automatic mod downloads and installs
96- ```c #
103+ ```csharp
97104void Example ()
98105{
99106 Result result = ModIOUnity .EnableModManagement (ModManagementDelegate );
@@ -117,7 +124,7 @@ void ModManagementDelegate(ModManagementEventType eventType, ModId modId, Result
117124
118125### Authenticate a user
119126In the current version of the plugin it is required that a user session is authenticated in order to subscribe and download mods . You can accomplish this with an email address or through another third party service , such as Steam or Google . Below is an example of how to do this from an email address provided by the user . A security code will be sent to their email account and can be used to authenticate (The plugin will cache the session token to avoid having to re -authenticate every time they run the application ).
120- ```c #
127+ ```csharp
121128async void RequestEmailCode ()
122129{
123130 Result result = await ModIOUnityAsync .RequestAuthenticationEmail (" johndoe@gmail.com" );
@@ -148,7 +155,7 @@ async void SubmitCode(string userSecurityCode)
148155```
149156
150157### Get Mod profiles from the mod.io server
151- ```c #
158+ ```csharp
152159async void Example ()
153160{
154161 // create a filter to retreive the first ten mods for your game
@@ -176,7 +183,7 @@ Users can also submit mods directly from the mod.io website by going to your gam
176183
177184### Adding a mod
178185Here we go through the mod addition flow . Generate Token , Create Mod Profile , and Upload Mod File
179- ```c #
186+ ```csharp
180187public async void CreateMod ()
181188{
182189 // token used to create mod profile
@@ -213,7 +220,7 @@ public async void CreateMod()
213220
214221### Loading mods
215222Here is an example that grabs all mods installed for the current user , finds the png files in the mod 's directory if they are tagged as a "Texture" and then loads them into a Texture2D asset.
216- ```c #
223+ ```csharp
217224public void LoadModExample ()
218225{
219226 UserInstalledMod [] mods = ModIOUnity .GetInstalledModsForUser (out Result result );
0 commit comments