Unity

Our Unity SDK adds a layer on top of the C# SDK. 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 game object in your scene as the SCILL Unity SDK implements UI code that requires the Unity Event System. If not, in Unity click on the GameObject -> UI -> EventSystem to add the required event system to your scene.

Example

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

This is a screenshot of the fully working Battle Pass Example 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 various methods to install the Unity SDK.

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

Package Manager

The best way is to clone the Unity SDK Github repository on your workstation. Then in Unity click on the menu Window -> Package Manager to open the Package Manager. In the Package Manager window, click on that + button and choose Add package from disk ....

Adding the SCILL Unity SDK with Package Manager

Adding the SCILL Unity SDK with Package Manager

Navigate to the folder with the cloned SCILL Unity SDK folder and choose the package.json file. Unity will import the package.

The advantage is, that you can pull new versions of our SDK and you can also commit bug fixes by committing your code in a separate branch and creating a merge request for us. This way we can review your code changes and integrate them in our main branch.

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

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.

In both cases, the base C# SDK can always be updates, as this is part of the SCILL Unity SDK and is in the SDK folder.

So, even if you have embedded our codebase and heavily modified it, you can always download the latest C# SDK and copy the SCILL.dll into the SDK path to upgrade to the latest version.

Unity Package

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

Double-click the file and Unity will ask you to import it. Confirm and import all assets for a quick start. It will be added into the folder SCILL Unity SDK in your Assets folder. You might exclude from your .gitignore if you don’t want to add our code to your own Git repository.

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 uses hard coded user id of 1234. Please select the SCILL Manager GameObject in the hierarchy of the sample scene and change the User Id setting to something random.

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.

1 Create 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.

2 SCILL 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.

3 Add 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.

4 Press 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.

5 Open 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).

6 Test 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.

7 Add 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.

8 Unlock 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.

8 Customize

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!

1 Create 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.

2 SCILL 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.

2 SCILL 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.

3 Add 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.

4 Press 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.

5 Open 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.

6 Test 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.

7 Add 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.

8 Unlock 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.

8 Customize

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.

1 Create 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.

2 SCILL 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.

3 Add UI

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

3 Set 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.

4 Press 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).

5 Open 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.

6 Test events

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

7 Add 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.

8 Customize

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);