Unity SDKs

You can use Unity SDKs for integrating Xsolla products in your Unity projects.

System Requirements

  • 64-bit OS
  • Windows 7 SP1 and higher
  • macOS 10.12 and higher
  • DirectX 10
  • Visual Studio 2015
  • A compatible version of Unity:
    • 2018.3.0f2
    • 2019.3.4f1

Please note that you can use only the Mono compiler for creating a game build.

Target OS

  • iOS
  • Android
  • Linux
  • macOS
  • Windows 32-bit
  • Windows 64-bit

Prerequisites

  1. Download Unity.
  2. Pick a personal or professional Unity license based on your preferences.
  3. Create a new Unity project.
  4. Download the asset from the Unity Assets Store or GitHub.

  1. Add Login demo scene in build settings:
    1. Go to Assets > Xsolla > Demo > LoginDemo > Scenes and launch the Login scene.
    2. Open File > Build settings and click Add Open Scenes.
  2. Do the same for the Store demo scene found in Assets > Xsolla > Demo > StoreDemo > Scenes.

  1. Check that demo scenes were added in the following order:
    • 0 - Login
    • 1 - Store

  2. Make sure that only the Login scene remains open in the Hierarchy window.

  1. Try Login Demo or Store Demo if needed.
  2. Make sure that the Mono сompiler is used for creating a game build:
    1. Click Edit > Project Settings in the main menu.
    2. Go to Other Settings > Configuration block.
    3. Make sure that Mono is chosen in Scripting Backend field.

  1. Create your Xsolla Publisher Account.
  2. Set up a Publisher Account project created automatically after creating the Publisher Account:
    1. Click My game in Projects block and go to Project settings.
    2. In setup mode specify Project name and click Save.
    3. Go to Integration settings and check that the Integrate new Store management methods toggler is enabled.

You can create a new project by clicking the + icon in the Projects block.

Login Unity SDK

The Login Unity SDK is used to integrate Xsolla Login API methods with apps based on Unity. Main features:

  • authenticating via username and password
  • signup
  • email confirmation
  • password reset
  • authenticating via Steam session_ticket
  • cross-platform account linking. To enable this feature, please email the Xsolla integration team (integration@xsolla.com)

The solution works for:

  • storing user data at Xsolla’s side
  • authentication via email/username and password
  • authentication via Steam

Demo

The integration demo is available in the Assets > Xsolla > Demo > LoginDemo > Scenes folder. You can use it as an example.

By default, the demo uses the Xsolla Login ID of a pre-set Publisher Account project.

Default values for the Login demo scene:

  • login ID: e6dfaac6-78a8-11e9-9244-42010aa80004
  • username: xsolla
  • email: support@xsolla.com
  • password: xsolla

Integration

To integrate the Login Unity SDK:

  1. Set up Login in your Publisher Account. You will need a Login ID, found in Login settings > Login ID. It has the UUID format.

  1. Set up the asset for your Unity project.

Setting up Login in Publisher Account

  1. Go to your project and click Connect in the Login block.

  1. Open Login settings.
  2. Go to Login projects and click New Login.

  1. Specify a Login name and click Create.

  1. Go to General settings > URL block and specify the Callback URL, which the user is redirected to after the email confirmation or password reset.
  2. Select the Xsolla storage in the User data storage block.

Setting up the Asset for Your Unity Project

  1. Go to your Unity project.
  2. Click Window > Xsolla > Edit Settings in the main menu. In the Inspector window, fill in the Login ID.

  1. Go to Assets > Xsolla > Demo > Login Demo > Scenes and launch the Login scene.
  2. Create a new user and check for the confirmation email.

  1. Log in as a new user and change the password if necessary.

You can customize the integration demo settings if needed:

Store Unity SDK

The Xsolla Store Unity SDK is used to integrate Xsolla Store API methods with apps based on Unity.

The solution works for:

  • selling virtual items
  • managing your in-game store
  • managing user inventory
  • managing user attributes
  • cross-platform account linking. To enable this feature, please email the Xsolla integration team (integration@xsolla.com)

Before using the plugin, you need to set up Store and Login modules in your Publisher Account. For integration you will need:

  • Project ID found in Project settings > Project ID.

  • Login ID found in Login settings > Login ID. It has the UUID format.

Demo

The integration demo scenes are available in Assets > Xsolla > Demo folder. You can use the demo scene as an example.

By default, demo uses Xsolla Project ID and Login ID of the pre-set Publisher Account project that has a fully configured store.

Store is available in two demo scenes:

  • To test the Login and Store modules connected, launch the Login Demo scene from the Assets > Xsolla > Demo > LoginDemo > Scenes folder. If the authentication succeeds, the Store Demo scene will be opened for the default user and the user’s pre-configured project.
  • To test the Store module only, launch the Store Demo scene from the Assets > Xsolla > Demo > StoreDemo > Scenes folder. No registration required to test the Store module.

Default values for the demo scenes:

  • login ID: e6dfaac6-78a8-11e9-9244-42010aa80004
  • username: xsolla
  • email: support@xsolla.com
  • password: xsolla
  • project ID: 44056

Integration

To integrate the Store Unity SDK:

  1. Set up the Virtual Items module in your Publisher Account.
  2. Set up the asset for your Unity project.

Setting up the Virtual Items module in your Publisher Account

  1. Go to your project and click Connect in the Store block.

  1. Click Connect in the Virtual Items block.

  1. Click Create a group.

  1. Specify Group code and Group name, turn on the group display in Store. Click Create group.

  1. Create items, specifying the following info for each of them:
    • one or more groups that the item should belong to
    • SKU
    • name and a short description
    • prices in real and virtual currencies
    • image (optional)

  1. Make sure that the group status is Enabled.

Setting up the Asset for Your Unity Project

  1. Click Window > Xsolla > Edit Settings in the main menu. In the Inspector window:
    1. Fill in the Project ID.
    2. Tick the Enable sandbox checkbox.

  1. Go to Assets > Xsolla > Demo > Login Demo > Scenes > Login and create a new user. Check for the confirmation email.

  1. Log in as a new user and change the password if necessary.

  1. Go to Assets > Xsolla > Demo > Login Demo > Scenes and launch the Login scene. If you launch the Store Demo first, user change is unavailable.

You can customize the integration demo settings if needed:

Tutorials