Skip to content

Commit

Permalink
4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenlucerne committed Feb 22, 2023
1 parent 33c1479 commit df31f6c
Show file tree
Hide file tree
Showing 285 changed files with 90,074 additions and 69,042 deletions.
8 changes: 8 additions & 0 deletions Documentation.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
2 changes: 1 addition & 1 deletion FONT_EULA.pdf.meta → Documentation/FONT_EULA.pdf.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Documentation/Full_Documentation.pdf
Binary file not shown.
7 changes: 7 additions & 0 deletions Documentation/Full_Documentation.pdf.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
4 changes: 1 addition & 3 deletions LICENSE.md.meta → Documentation/LICENSE.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 30 additions & 29 deletions README.md → Documentation/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# <a href="https://www.youtube.com/watch?v=pmECrkdzHzQ">Watch the video tutorial</a>
<a href="https://www.youtube.com/watch?v=pmECrkdzHzQ"><img src="https://img.youtube.com/vi/pmECrkdzHzQ/0.jpg" alt="mod.io" width="420"/></a>

<a href="https://mod.io"><img src="https://beta.mod.io/images/branding/modio_logo_bluewhite.svg" alt="mod.io" width="360" align="right"/></a>
# Mod.io Unity Plugin v4.0.8
<a href="https://mod.io"><img src="https://mod.io/images/branding/modio-logo-bluedark.svg" alt="mod.io" width="360" align="right"/></a>
# mod.io Unity Plugin v4.1.0
[![License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/modio/modio-unity/blob/master/LICENSE)
[![Discord](https://img.shields.io/discord/389039439487434752.svg?label=Discord&logo=discord&color=7289DA&labelColor=2C2F33)](https://discord.mod.io)
[![Master docs](https://img.shields.io/badge/docs-master-green.svg)](https://github.com/modio/modio-unity-v2/wiki)
[![Unity 3D](https://img.shields.io/badge/Unity-2018.4+-lightgrey.svg)](https://unity3d.com)

Welcome to the mod.io Unity Engine plugin repository. It allows game developers to host and automatically install user-created mods in their games which use Unity 2018.4 or newer. It provides a UI for mod discovery, installation and collection management, and a C# interface which connects to the [mod.io REST API](https://docs.mod.io).

## Watch the video tutorial
<a href="https://www.youtube.com/watch?v=pmECrkdzHzQ"><img src="https://img.youtube.com/vi/pmECrkdzHzQ/0.jpg" alt="mod.io" width="420"/></a>

## Installation
Requires **Unity 2018.4** or later. Tested on Windows, and MacOS.
Requires **Unity 2019.4** or later. Developed for Windows, Mac, Linux, Xbox, PlayStation and Switch.

### Git Repository or .unitypackage
You can import the plugin directly from the [Unity Asset Store](https://assetstore.unity.com/packages/tools/integration/mod-browser-manager-by-mod-io-138866), or by downloading the package directly from the [Releases page](https://github.com/modio/modio-unity/releases). If you have any previous versions of the plugin installed, it is highly recommended to delete them before importing a newer version.
Expand All @@ -28,14 +30,17 @@ Alternatively, you can download an archive of the code using GitHub's download f

## Setting up the Browser UI

If you do not wish to create your own UI implementation you can use our default UI that comes built in to the plugin. (If you dont wish to use the UI it is safe to delete the UI folder located at Assets/Plugins/mod.io/UI)
If you do not wish to create your own UI implementation you can use our default UI that comes built in to the plugin. Examples of how the UI looks are provided below. (If you dont wish to use the UI it is safe to delete the UI folder located at Assets/Plugins/mod.io/UI)

1. Follow the steps above to setup the config.
2. Navigate to the ModIOBrowser prefab at Assets/Plugins/mod.io/UI/Examples and drag it into your scene.
3. Use the ModIOBrowser.Browser.OpenBrowser() method to open the browser in your scene.
`ModIOBrowser.Browser.OpenBrowser(null)`
4. The Browser UI is now setup!

![Example mod browser](https://assetstorev1-prd-cdn.unity3d.com/package-screenshot/a7f9360d-4837-4d6e-b5cb-db5544a27b8c_orig.png)
![Example mod collection](https://assetstorev1-prd-cdn.unity3d.com/package-screenshot/b37c33d6-aaa1-49c5-a6fd-c4ae18627bd2_orig.png)

## Authentication
In the current version of the plugin it is required that a user session is authenticated. Either via email or through another third party, such as Steam or Google. The process is fairly simply. Examples can be found below.

Expand All @@ -46,10 +51,10 @@ below are a couple examples for some of the common usages of the plugin. Such as
All 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.

### Initialise the plugin
```csharp
async void Example()
```c#
void Example()
{
Result result = await ModIOUnityAsync.InitializeForUser("ExampleUser");
Result result ModIOUnity.InitializeForUser("ExampleUser");

if (result.Succeeded())
{
Expand All @@ -63,25 +68,21 @@ async void Example()
```

### Get the user's installed mods
```csharp
```c#
void Example()
{
SubscribedMod[] mods = ModIOUnity.GetSubscribedMods(out Result result);
if (result.Succeeded())
UserInstalledMod[] mods = ModIOUnity.GetInstalledModsForUser(out Result result);

foreach(UserInstalledMod mod in mods)
{
foreach(var mod in mods)
{
if(mod.status == SubscribedModStatus.Installed)
{
string directoryWithInstalledMod = mod.directory;
}
}
// This is the location of the installed mod
string directory = mod.directory;
}
}
```

### Enable automatic mod downloads and installs
```csharp
```c#
void Example()
{
Result result = ModIOUnity.EnableModManagement(ModManagementDelegate);
Expand All @@ -105,7 +106,7 @@ void ModManagementDelegate(ModManagementEventType eventType, ModId modId, Result

### Authenticate a user
In 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).
```csharp
```c#
async void RequestEmailCode()
{
Result result = await ModIOUnityAsync.RequestAuthenticationEmail("johndoe@gmail.com");
Expand Down Expand Up @@ -136,7 +137,7 @@ async void SubmitCode(string userSecurityCode)
```

### Get Mod profiles from the mod.io server
```csharp
```c#
async void Example()
{
// create a filter to retreive the first ten mods for your game
Expand All @@ -158,14 +159,14 @@ async void Example()
```

##Submitting mods
You can also submit mods directly from the plugin. Refer to the documentation for methods such as ModIOUnity.CreateModProfile and ModIOUnity.UploadModfile.
You can also submit mods directly from the plugin. Refer to the documentation for methods such as `ModIOUnity.CreateModProfile` and `ModIOUnity.UploadModfile`.

Users can also submit mods directly from the mod.io website by going to your game profile page. Simply create an account and upload mods directly.

## Example Usages
### Loading mods
Here is an example that grabs all mods installed for the current user, finds the png files in the mod's directory and then loads them into a Texture2D asset.
```csharp
Here 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.
```c#
public void LoadModExample()
{
UserInstalledMod[] mods = ModIOUnity.GetInstalledModsForUser(out Result result);
Expand All @@ -174,7 +175,7 @@ Here is an example that grabs all mods installed for the current user, finds the
foreach(var mod in mods)
{
//Tags are USER defined strings for a game and are setup in the web portal.
var textureTag = "Texture";
string textureTag = "Texture";

string directoryWithInstalledMod = mod.directory;

Expand Down Expand Up @@ -208,14 +209,14 @@ The [mod.io](https://mod.io) Unity Plugin requires the functionality of two othe
* SharpZipLib to zip and unzip transmitted files. ([GitHub Repo](https://github.com/icsharpcode/SharpZipLib))
## Benefits
mod.io offers the same core functionality as Steamworks Workshop (1 click mod installs in-game), plus mod hosting, moderation and all of the critical pieces needed. Where we differ is our approach to modding and the flexibility a REST API offers. For example: 
mod.io offers the same core functionality as Steamworks Workshop (1 click mod installs in-game), plus mod hosting, moderation and all of the critical pieces needed. Where we differ is our approach to modding and the flexibility a REST API offers. For example:

* We make mods cross platform accessible. That means users can upload a mod on PC and someone else can play it on the Xbox, for example.
* Our API is not dependent on a client, platform or SDK, allowing you to run mod.io in many places such as your homepage and launchers.
* Designing a good mod browsing UI is hard, our plugin ships with a UI built in to save you a lot of effort and help your mods stand out.
* We dont apply rules globally, so if you want to enable patronage, sales or other experimental features, reach out to discuss.
* Our platform is built by the super experienced ModDB.com team and is continually improving for your benefit.
* Your community can consume the mod.io API to build modding fan sites or discord bots if they want.
* Communicate and interact with your players, using our built-in emailer

## Large studios and Publishers
A private white label option is available to license, if you want a fully featured mod-platform that you can control and host in-house. [Contact us](mailto:developers@mod.io?subject=Whitelabelto discuss.
Expand Down
2 changes: 1 addition & 1 deletion README.md.meta → Documentation/README.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit df31f6c

Please sign in to comment.