Unity SDK

Our Unity SDK uses a special version of the C# SDK. It uses UnityWebRequest instead of standard .NET requests and comes with some other customizations that are required for WebGL support. It mostly provides UI code and prefabs that you can use as a starting point for your SCILL integration directly into your game.

Our Unity SDK offers a quick “go to market” solution that you can just “drag & drop” into your game. The prefabs we provide are fully functional and handle all the heavy lifting with the SCILL cloud. They are completely open-source, and you are welcomed to adjust them to your own needs. Prefabs quickly can be adjusted to your games UI with prefab variants.

The main functionality is implemented by the classes, but virtual functions allow you to quickly make adjustments by overriding these classes and methods to adjust certain aspects of our implementation.

Tip

Please make sure you have the Event System script in your scene, as the SCILL Unity SDK uses UI code that requires the Unity Event System. To add a Event System to your scene in Unity, right-click into the hierarchy window and select the GameObject -> UI -> EventSystem option.

Video Tutorial

David Liebemann (CrystalMesh) has compiled an easy to follow and understandable video tutorial on how to add SCILL to your game and guides you to the first steps of leveraging our great tool kit to quickly integrate high-tech features like cloud based realtime challenges and leaderboards.

Production Ready Prefabs

Our Unity SDK comes with fully working prefabs and samples with complete implementation of a battle pass and challenges. We have used Game Assets from Kenney for the samples, which are slim and awesome. Thank you very much Kenney for making those public domain.

This is a screenshot of the fully working Battle Pass UI Prefab with reward selection, realtime challenges and progress tracking.

Unity example of an example shooter battle pass

Unity example of an example shooter battle pass

SCILL also offers simple challenges that can be utilized for many things like “Weekly Challenges”, giving your players enough to do each week and also allows users to collect rewards, coins and/or experience points.

Unity example of an personal challenges

Unity example of an personal challenges

Source Code

You can find the source code to our Unity SDK in our public Github repository: https://github.com/scillgame/scill-unity. If you encounter any bugs or issues, please let us know in the Issues tab of Github.

If you fix a bug in our code base, please commit your bugfix in a separate branch and create a merge request with a short description what you have fixed. Of course, we will credit you and your game in the changelog and at the start page of our Github repository in this case!

Installing the SDK

You have the various methods to install the Unity SDK.

  • Using the Package Manager (recommended)
  • Unity Package
  • Download and “merge” with your Project.

Package Manager

Using the package manager will ensure that all dependencies are set up correctly and that you will have the most up to date version of our SDK. In most cases, using the Package Manager is the way to go.

Adding from git URL

In Unity click on the menu Window -> Package Manager to open the Package Manager. In the Package Manager window, click on the + button and choose Add package from git URL ..., with this URL: https://github.com/scillgame/scill-unity.git?path=/unity-package

Tip

To use the Add package from git URL ... option, please make sure the Git client (minimum version 2.14.0) is installed on your machine and that you have added the Git executable path to the PATH system environment variable. Take a look at the Unity Documentation for further information on using Git dependencies in the Unity Package Manager.

Don’t forget to also import the Sample 1 into your project if you’d like to test and change the sample scenes we created for you.

Importing the samples from the Git repository.

Importing the samples from the Git repository.

To update the SCILL Unity SDK, just add the package using the git URL method again - the Package Manager will automatically update the current local version to the newest available version in the repository.

Adding from disk

For this method you will need to first clone the SCILL Unity SDK from our github repository. In the Package Manager window, click on the + button and choose Add package from disk .... Navigate to the \unity-package directory within the local repository on your device and select the package.json file. Unity will then import the package and resolve the dependencies.

Adding the SCILL Unity SDK with Package Manager

Adding the SCILL Unity SDK with Package Manager

The advantage is, that you can pull new versions of our SDK and you can also directly work on the source code. So if you find and fix a bug, you can submit it to your fork and send a pull request to us, describing the changes you made. This way we can review your code changes and integrate them into our main branch. Of course, we will credit you and your game in the changelog and at the start page of our Github repository in this case!

Unity Package

Please download the SCILL Unity SDK as a .unitypackage from our Github releases page. Download: SCILL-Unity-SDK.unitypackage

Because Unity does not resolve dependencies automatically when importing Assets as a .unitypackage, you will need to ensure that Unity’s Newtonsoft-JSON package has been added to your project. To add the Newtonsoft package to your project, navigate to the Package Manager by using the Window -> Package Manager menu. In the Package Manager window, click on the + button, choose Add package from git URL ... and enter the package reference: com.unity.nuget.newtonsoft-json

Download and add source code

You can also download the ZIP file from Github and add the contents of the ZIP file into your Unity Asset folder. This way, our SDK will be “merged” with your project. If you commit your code to a Version Control System (like Git) then you will commit SCILL source files into your own repo.

Which way to choose?

It depends on how you want to leverage SCILL. If you want to use our SDK as is and don’t plan to change much yourself, then it’s best to use the Package Manager approach. You will profit from new features by just pulling the latest version in the cloned repo.

If you want to heavily change SCILLs code or prefabs, it’s perhaps best to merge the code into your codebase. This way it will be perhaps a bit harder to get new features, but if you plan to build on top of our code, you will most likely have built them either yourself or you don’t care.

Using the Samples

In the Sample 1/Scenes folder we have prepared a couple of scenes you can try out. These samples are linked to an example App. You may see the battle pass or challenges not in a fresh state, as the sample scene uses a hard coded user id for testing. In this case please select the SCILL Manager GameObject in the hierarchy of the sample scene and change the User Id setting to something random. When leaving the User Id field empty, the SCILLManager Script will attempt to use your device unique identifier.

After that, you’ll see the battle pass or challenges in a fresh state (of course if nobody before chose that user id before).

Replace the API-Key and App-ID in the SCILL Manager settings with your own values et voilĂ : You have a fully working battle pass!

Of course, there are various other ways to add our SDK to Unity:

Personal Challenges

Challenges are a nice way of adding user interaction into your game by letting users pick challenges and pickup rewards once they have achieved those challenges. Personal Challenges are defined like this:

  • Need to be unlocked and activated (not necessarily by users)
  • Have a duration (in minutes)
  • Can be repeatable - users can try over and over again, or they are a one-shot

Follow this Step-by-Step guide to add Personal Challenges to your game.

1Create Challenges

In the Admin Panel create an app, and API key for the app, create categories and challenges. More info on this topic can be found in our Guides section.

2SCILL Manager

Add the SCILL Manager prefab into your scene and set your app settings like the API key and the App Id. Also make sure a User Id is set. For testing purposes you can choose anything you like, but in further testing you need to override the SCILLManager class and implement your own GetUserId method.

3Add UI

Drag & Drop either Personal Challenges List or Personal Challenges Grid into your canvas or use the Personal Challenges Canvas prefab which comes with a Canvas and implements both versions. Delete the one you don’t like and proceed.

4Press Play

Run your application and depending on the user interface you choose you will now see a list of challenges that you have created earlier in the Admin Panel. Play around with unlocking and activating challenges. Everything is already working for you.

5Open Playground

Select the SCILL Manager prefab in your scene. Click on the three dots in the Inspector of the SCILLManager script to reveal the component menu. There you’ll find the Open Playground menu item. A new browser window will be opened with the Playground application setup already with the same values you used in Unity. You should see the same challenges in the same state as you see in Unity. Unlocking or activating a challenge will be immediately reflected in the Unity UI (in play mode of course).

6Test events

Use the Playground application to setup an event that will trigger one of your challenges you have created and press “Send Event”. Make sure the challenge is activated and unlocked. Whenever you send an event, it will progress in Playground and Unity (in play mode) and will show a “Claim” button once the challenge has been achieved.

7Add events

Below the “Send Event” button you’ll see code generated for you that you just need to Copy & Paste in your applications source code. Just select the “Unity” tab which will generate code suited to be used together with the SCILLManager prefab.

8Unlock rewards

Depending on your settings, Challenges have rewards that users can claim. There are various different methods of unlocking rewards to the user, however, the simplest approach is to derive a new class from SCILLPersonalChallenges and override the OnPersonalChallengeRewardClaimed function.

8Customize

Create prefab variants of our prefabs and customize colors, font and layout to fit your games UI.

That’s it. You have added SCILL Personal Challenges to your game.

We have prepared a much more detailed guide with screenshots and code examples in this example integration:

Tanks (Unity)

We took this simple but fun open source Unity tank game and added challenges to it. Use our example code as a starting point for your own Unity based project.

Learn more

Battle Passes

Our Battle Passes are built on top of the challenge system, but they can both co-exist in a game. Fortnite for example combines both elements with weekly challenges to earn coins and battle passes as a monetization tool, delivering great and unique rewards only available in battle passes that users must purchase.

Our battle pass system is very flexible yet easy to implement:

  • Battle Passes have a start and end date, which allows you to sell multiple battle passes per user with a seasoning approach.
  • Battle Passes are compiled of levels that can have a reward
  • Levels are locked by default (the first level is unlocked once the battle pass is unlocked for the user)
  • Levels contain one or more challenges which must all be achieved before the level is complete
  • Completed levels automatically unlock the next level and users can claim the reward.

It depends on your game how deep you want to integrate our battle pass system. You can either add it as a monetization feature but you can also control the flow of your game using our battle passes. For example you can connect your maps or levels to the battle pass levels, that is, users first need to unlock a certain level in the battle pass before they can play a new map.

Follow this Step-by-Step guide to add Battle Passes to your game. Please note: That’s a very detailed description of what you should do. You’ll have a basic but fully functional battle pass integrated into your game within 1-2 hours!

1Create Challenges

In the Admin Panel create an app, and API key for the app, create categories and challenges. More info on this topic can be found in our Guides section. Once you have created the challenges, you can copy them to the Battle Pass system. Of course you can also directly can create battle pass challenges, but it’s easier to test personal challenges than battle pass challenges.

2SCILL Manager

Add the SCILL Manager prefab into your scene and set your app settings like the API key and the App Id. Also make sure a User Id is set. For testing purposes you can choose anything you like, but in further testing you need to override the SCILLManager class and implement your own GetUserId method.

2SCILL Battle Pass Manager

Add the SCILL Battle Pass Manager script onto your manager GameObject. The battle pass manager will load available battle passes and will select the first one. If you want to customize selection, override the class and implement your own selection mechanism.

3Add UI

Drag & Drop the Battle Pass Canvas into your scene. It will have everything included that is required. Battle Pass levels, unlock button to unlock/purchase the battle pass, active challenges and UI to navigate the levels and to preview rewards.

4Press Play

Run your application and depending on the user interface you choose you will now see the battle pass available in the Admin Panel. If you created multiple battle passes make sure the SCILL Battle Pass Manager selected the correct one. You can navigate the levels and you can unlock the battle pass. for you.

5Open Playground

Select the SCILL Manager prefab in your scene. Click on the three dots in the Inspector of the SCILLManager script to reveal the component menu. There you’ll find the Open Playground menu item. A new browser window will be opened with the Playground application setup already with the same values you used in Unity. You should see the same state as you see in Unity.

6Test events

Use the Playground application to setup an event that will trigger one of your challenges you have created and press “Send Event”. Make sure the challenge is activated and unlocked. Whenever you send an event, it will progress in Playground and Unity (in play mode) and will show a “Claim” button once the challenge has been achieved. Start sending events in Playground and notice how levels get unlocked in real time in Unity (in play mode). More info on Playground can be found here.

7Add events

Below the “Send Event” button you’ll see code generated for you that you just need to Copy & Paste in your applications source code. Just select the “Unity” tab which will generate code suited to be used together with the SCILLManager prefab.

8Unlock rewards

Implement a new class in Unity and add a listener on the OnBattlePassLevelRewardClaimed event available in the SCILLBattlePassManager class. Example code can be found in the SCILL Battle Pass Manager reference.

8Customize

Create prefab variants of our prefabs and customize colors, font and layout to fit your games UI.

That’s it. You have added SCILL Battle Passes to your game.

Leaderboards

Leaderboards are a must have for each and every game. It’s the simplest and yet one of the most powerful tools for user retention. Core features of our leaderboards:

  • Driven by the events you already send to SCILL
  • Define the sort order, events types to process - that’s it

Follow this Step-by-Step guide to add Personal Challenges to your game.

1Create Leaderboard

In the Admin Panel create an app, and API key for the app and create a leaderboard. More info on this topic can be found in our Guides section.

2SCILL Manager

Add the SCILL Manager prefab into your scene and set your app settings like the API key and the App Id. Also make sure a User Id is set. For testing purposes you can choose anything you like, but in further testing you need to override the SCILLManager class and implement your own GetUserId method.

3Add UI

Drag & Drop either Leaderboard into your canvas or use the Leaderboard Canvas prefab which comes with a predefined canvas.

3Set your leaderboard id

In the inspector of leaderboard instance in the SCILLLeaderboard script, set the Leaderboard ID to the id of the leaderboard. See SCILLLeaderboard for more info on that.

4Press Play

That’s it. You have a fully functional leaderboard. If it’s empty, make sure you send some events that trigger the leaderboard (i.e. the event names and the event name defined when creating the leaderboard as well as any meta data must match).

5Open Playground

Select the SCILL Manager prefab in your scene. Click on the three dots in the Inspector of the SCILLManager script to reveal the component menu. There you’ll find the Open Playground menu item. A new browser window will be opened with the Playground application setup already with the same values you used in Unity. You should see the same leaderboards in the same state as you see in Unity.

6Test events

Use the Playground application to define an event that will trigger your leaderboard you have created and press “Send Event”.

7Add events

Below the “Send Event” button you’ll see code generated for you that you just need to Copy & Paste in your applications source code. Just select the “Unity” tab which will generate code suited to be used together with the SCILLManager prefab.

8Customize

Create prefab variants of our prefabs and customize colors, font and layout to fit your games UI.

That’s it. You have added a SCILL leaderboard to your game.

FAQ

A couple of answer to typical questions:

How to handle date objects?

The dates in the responses can be converted to native C# Date objects using this code:

var date = DateTime.Parse(challenge.user_challenge_activated_at);