You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Documentation/UPGRADING.md
+42-44
Original file line number
Diff line number
Diff line change
@@ -19,12 +19,12 @@ All calls into async functions on the new mod.io Unity Plugin provide a single c
19
19
This provides a much clearer calling convention and gives a guarantee of one operation completion - one callback invocation, rather than the two callbacks required by async functions in mod.io Unity V1.
20
20
21
21
Here is an example of the usage with a callback and an await:
Initialization in mod.io Unity V1 was handled mostly statically, pulling the details from the `Resources/modio_settings` asset during static initialization.
49
49
Optionally, a developer could set the user data directory by calling `UserDataStorage.SetActiveUser()` as seen in the sample below.
50
-
```c#
51
-
voidmodioUnityV1Example()
50
+
```csharp
51
+
voidModioUnityV1Example()
52
52
{
53
53
// Optional (Sets the user data directory)
54
54
stringuserProfileIdentifier="local_game_user_id"; // Local User Account Identifier
@@ -58,7 +58,7 @@ void modioUnityV1Example()
58
58
Apart from this, there are no initialization possibilities in mod.io Unity V1.
59
59
60
60
For the new mod.io Unity Plugin, we have kept an automatic initialization option that pulls the data from the `Resources/mod.io/config` asset, similar to the function of mod.io Unity V1. However, there are also explicit initialization methods and shutdown methods that can be utilized if automatic initialization is disabled in the config asset.
61
-
```c#
61
+
```csharp
62
62
voidInitializationExample()
63
63
{
64
64
stringuserProfileIdentifier="local_game_user_id"; // Local User Account Identifier
@@ -74,8 +74,8 @@ mod.io Unity V1 built the synchronization of an authenticated user's subscriptio
74
74
This has not changed in the new mod.io Unity Plugin, but the process of keeping that data synchronized is much easier, along with fetching the data for the subscribed mods.
75
75
76
76
Adding, synchronizing, and retrieving subscription data in mod.io Unity V1 involves chaining multiple calls together.
77
-
```c#
78
-
voidmodioUnityV1Example()
77
+
```csharp
78
+
voidModioUnityV1Example()
79
79
{
80
80
intnewSubModId=123;
81
81
intnewUnsubModId=456;
@@ -102,35 +102,23 @@ void modioUnityV1Example()
102
102
```
103
103
104
104
The new mod.io Unity Plugin streamlines this process by reducing the need for callback chaining, synchronizing immediately for local changes, and removing the need to handle the mod ids.
105
-
[FetchUpdates()](https://sdkdocs.mod.io/unity/class_mod_i_o_1_1_mod_i_o_unity.html#aab9e3eb7697f13e4e96273ac50ab79af) is the single synchronization function on the interface, handling all synchronization actions.
106
-
```c#
105
+
[FetchUpdates()](https://sdkdocs.mod.io/unity/class_mod_i_o_1_1_mod_i_o_unity.html#aab9e3eb7697f13e4e96273ac50ab79af) is the single synchronization function on the interface, handling all synchronization actions and only needing to be run generally once per session (Ideally after you Initialize the plugin).
106
+
```csharp
107
107
voidExample()
108
108
{
109
-
intnewSubModId=123;
110
-
intnewUnsubModId=456;
111
-
112
-
// Pushes a subscribe attempt directly to the server, returning an error on failure
113
-
ModIOUnity.SubscribeToMod(newSubModId,
114
-
(Resultresult) => { /* callback code */ });
115
-
// Pushes an unsubscribe attempt directly to the server, returning an error on failure
Furthermore, the subscribe and unsubscribe operations automatically flag the mod as requiring installation/uninstallation, a responsibility placed on the consumer in mod.io Unity V1. (See below)
Likewise in mod.io Unity V1, the new mod.io Unity Plugin allows the sharing of installed mods across multiple users to save network traffic and storage space.
130
118
131
119
mod.io Unity V1 didn't have a direct method of retrieving the mods installed for the current user. There are a variety of different methods that need to be chained together to retrieve a complete picture of the installed mod data.
132
-
```c#
133
-
voidmodioUnityV1Example()
120
+
```csharp
121
+
voidModioUnityV1Example()
134
122
{
135
123
// Retrieves a de-identified list of mod directories for mods the user has "enabled"
136
124
boolonlyEnabledMods=true;
@@ -157,7 +145,7 @@ void modioUnityV1Example()
157
145
```
158
146
159
147
The new mod.io Unity Plugin makes this much simpler, giving you all the information in a single call, returning a [UserInstalledMod](https://sdkdocs.mod.io/unity/struct_mod_i_o_1_1_user_installed_mod.html) array (and a `Result`).
The new mod.io Unity Plugin has the business rules of "Subscription = install and update" built into it, such that the download, extract, and uninstall processes are managed automatically by the [Mod Management Loop](https://sdkdocs.mod.io/unity/class_mod_i_o_1_1_mod_i_o_unity.html#aabba78ef1b55e60e2334cc1ba6faf1c3), a process that runs asynchronously to detect changes to the subscriptions and automate mod data management.
169
157
170
158
mod.io Unity V1 handled the installation and uninstallation of mods in the ModBrowser code, but any developer looking to exclude that code or understand the installation process had a more difficult time.
171
-
```c#
172
-
voidmodioUnityV1Example()
159
+
```csharp
160
+
voidModioUnityV1Example()
173
161
{
174
162
/// === Add a new subscription and install ===
175
163
intnewSubModId=123;
@@ -228,7 +216,7 @@ This is one of the key processes that has been streamlined in the new mod.io Uni
228
216
229
217
A call to [ModIOUnity.EnableModManagement](https://sdkdocs.mod.io/unity/class_mod_i_o_1_1_mod_i_o_unity.html#aabba78ef1b55e60e2334cc1ba6faf1c3) starts the background process of monitoring for subscription changes, and takes a (nullable) callback for mod management events. This can be disabled at any point with a call to [ModIOUnity.DisableModManagement](https://sdkdocs.mod.io/unity/class_mod_i_o_1_1_mod_i_o_unity.html#a7eda62ae267aa409b6408fd60ed16429).
230
218
Any changes invoked locally, and any changes retrieved with [ModIOUnity.FetchUpdates](https://sdkdocs.mod.io/unity/class_mod_i_o_1_1_mod_i_o_unity.html#aab9e3eb7697f13e4e96273ac50ab79af) are automatically queued and actioned.
"Once you've created a game profile on mod.io (or test.mod.io), enter your game ID and API key above in order for the plugin to retrieve mods and information associated with your game.",
0 commit comments