Skip to main content
Version: 26.2.9

Launch the Skillz UI

This article will walk you through the steps required to launch the Skillz UI. Make sure you've implemented the Skillz Delegate before continuing.

Initialize Skillz

Skillz needs to be initialized in the relevant area of your game. 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 game. Typically, Skillz is launched from your game's start screen. Specifically, we recommend that your game's start screen has a button launch Skillz when it is clicked. The examples below all follow that pattern.

public sealed class MatchController : MonoBehaviour
{
public void LaunchSkillz()
{
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.

Build and Test

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 it for iOS or Android.

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
using SkillzSDK;
using UnityEngine;

public sealed class SkillzGameController : SkillzMatchDelegate
{
public void OnSkillzWillExit()
{
SceneManager.LoadScene("MainMenu");
}
}

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.