How to Handle Match Start

Update your OnMatchWillBegin and OnSkillzWillExit callbacks inside your new Sync Controller class.

 

OnMatchWillBegin

Make sure to load your game scene in this function. SKZMatchInfo matchInfo is a data structure that contains information about the current match and the player in it. The data contained within can be used to display information to players or to power external analytics. You can use the IsSynchronous boolean in the SkillzSDK.Match object to determine whether the match is synchronous or asynchronous. (You can also fetch this object directly from the Skillz API by calling GetMatchInfo).

Example:

public void OnMatchWillBegin(SkillzSDK.Match matchInfo)
{
    if (matchInfo.IsSynchronous)
    {
        isSyncMatch = true;
    }
    else
    {
        isSyncMatch = false;
    }
    SceneManager.LoadScene("Game-c#");
}


OnSkillzWillExit (optional)

The OnSkillzWillExit method is called when the Skillz portal is exited; it should be used to load the menu state of your game. 

Example:

public void OnSkillzWillExit ()
{
    SceneManager.LoadScene("Menu-c#");
}

Next Step: Send and Receive Data