Skip to main content
Version: 27.2.8

Launch the Skillz UI

Overview

Once the Skillz SDK is added to your project (Link to Install SDK page), it is time to start setting up the core of your game loop, launching the Skillz UI. Standard user flow is App Launch -> Landing Page -> Launching the Skillz UI and from within the UI your players will have a variety of different interface to interact with. To understand more about the Skillz UI, please refer to this documentation.

The below steps will walk you through setting up some core elements of the Skillz SDK, helping you to accomplish your first steps of your Skillz integration.

Important Note for Unity Integrations

To better understand how the Skillz SDK works with Unity please refer to our guidance on Unity Script Execution

Implement the SkillzDelegate

Control of your application is given to Skillz when you launch the Skillz UI. Because of this, you'll need to implement the Skillz Delegate interface, which contains callbacks that will be invoked for key events. There are three events that are essential for interacting with Skillz:

  1. When a match is starting.
  2. When the user is exiting the Skillz UI (via the sidebar menu).
  3. When trying to enter the Progression Room

For Unity, you need to implement the SkillzMatchDelegate interface as a regular C# class. This will be instantiated when launching Skillz later.

SkillzGameController.cs
using SkillzSDK;

public sealed class SkillzGameController : SkillzMatchDelegate
{
// Called when a player chooses a tournament and the match countdown expires
public void OnMatchWillBegin(Match matchInfo) {

}

// Called when a player clicks the Progression entry point or side menu. Explained in later steps
public void OnProgressionRoomEnter() {

}

// Called when a player chooses Exit Skillz from the side menu
public void OnSkillzWillExit() {

}
}

Full implementation of these methods is covered later

Initialize Skillz

Once you have at least stubbed in the delegate functions, you are not able to initialize Skillz. This is usually right after your game's process has finished launching or in your game's start screen (if there is one).

You must initialize Skillz before you can launch it.

Skillz is initialized when your game starts up. Make sure you have configured your game appropriately.

Launch Skillz

With Skillz initialized, you can now launch it to take over control of your interface. Typically, Skillz is launched from your game's start screen. Specifically, we recommend that your game's start screen has a button to launch Skillz when it is clicked. The examples below all follow that pattern.

TitleScreenController.cs
public sealed class TitleScreenController : MonoBehaviour
{
public void PressPlayButton() {
SkillzCrossPlatform.LaunchSkillz(new SkillzGameController());
}
}

To launch Skillz, you must pass in an object that implements the Skillz Delegate.

Note: Skillz Unity Lifecycle

The Skillz SDK does not change scenes. The Skillz Unity UI is a native iOS/Android Activity. So you'll only detect an OnApplicationPause when it loads or unloads.

Skillz Lifecycle

To prevent problems with residual game-state, our suggestion is to create a simple "Loading" scene. Whenever you invoke either of the Skillz functions SkillzCrossPlatform.LaunchSkillz(new SkillzGameController()), or SkillzCrossPlatform.ReportFinalScore(score) - your code should also load your "Loading" scene via SceneManager.LoadScene. This will force your current scene to unload, so that way every match will start with totally fresh assets.

If your game is not making use of loading separate scenes - then instead of calling SceneManager.LoadScene - your code is instead responsible for cleaning up all of the variables and game-state in the current scene.

Exit Skillz

Users can exit Skillz via a sidebar menu item. When this happens, a callback in your Skillz Delegate implementation is invoked. You'll want to handle this callback to load an appropriate game screen. This typically will be the main menu/start screen.

SkillzGameController.cs
// ...
public void OnSkillzWillExit() {
SceneManager.LoadScene("StartMenu");
}
// ...

Build and Test

The completed Skillz Delegate should resemble this:

SkillzGameController.cs
using SkillzSDK;
using UnityEngine.SceneManagement;

public sealed class SkillzGameController : SkillzMatchDelegate
{
private const string GameScene = "Level1"; // Your game scene name
private const string ProgressionRoomScene = "ProgressionRoom"; // Your player progression room
private const string StartMenuScene = "StartMenu"; // Your menu scene exiting Skillz will return to (optional)

// Called when a player chooses a tournament and the match countdown expires
public void OnMatchWillBegin(Match matchInfo) {
// This is where you launch into your competitive gameplay
SceneManager.LoadScene(GameScene);
}

// Called when a player clicks the Progression entry point or side menu. Explained in later steps
public void OnProgressionRoomEnter() {
SceneManager.LoadScene(ProgressionRoomScene);
}

// Called when a player chooses Exit Skillz from the side menu
public void OnSkillzWillExit() {
SceneManager.LoadScene(StartMenuScene);
}
}

You should now be able to launch the Skillz UI from your game. Please build your game and verify that Skillz can launch from a mobile device in order to get your first checkmark in the Developer Console. If your game is made with Unity, you can simulate launching Skillz from the editor by using the Unity Companion before exporting and building for iOS or Android.

Next Steps

In this article, you learned how to launch the Skillz UI from your game. The next article will describe how to start matches.