Unity API Reference
Classes
SkillzCrossPlatform
The main point of interaction with Skillz.
LaunchSkillz
Launches the Skillz UI. This method is overloaded.
public static void LaunchSkillz(SkillzMatchDelegate _matchDelegate);
Parameters
_matchDelegate
A reference to a SkillzMatchDelegate
instance that Skillz will use.
public static void LaunchSkillz(SkillzSyncDelegate _syncMatchDelegate);
Parameters
_syncMatchDelegate
A reference to a SkillzSyncDelegate
instance that Skillz will use.
IsMatchInProgress
Checks if a match is currently in progress.
public static bool IsMatchInProgress();
Returns
A bool indicating if a match if is in progress.
GetMatchRules
Returns the match rules that you set up in the Skillz Developer Console for each match type.
public static Hashtable GetMatchRules();
Returns
A Hashtable
containing a key-value pair for each rule of the current match type.
GetMatchInfo
public static Match GetMatchInfo();
Returns
A Match
object containing information about the current match in progress.
AbortMatch
Forfeits the current match and returns to the Skillz UI.
public static void AbortMatch();
UpdatePlayersCurrentScore
Call this method every time the player's score changes during a Skillz match. This method is overloaded.
SkillzCrossPlatform.UpdatePlayersCurrentScore(string score);
Parameters
score
The player's current score as a string.
SkillzCrossPlatform.UpdatePlayersCurrentScore(int score);
Parameters
score
The player's current score as an integer.
SkillzCrossPlatform.UpdatePlayersCurrentScore(float score);
Parameters
score
The player's current score as a float.
ReportFinalScore
Call this method when a player finishes a match. This will report the result of the game to the Skillz server, and return the player to the Skillz UI. This method is overloaded.
public static void ReportFinalScore(String score)
Parameters
score
The player's final score as a string.
public static void ReportFinalScore(int score)
Parameters
score
The player's final score as an integer.
public static void ReportFinalScore(float score)
Parameters
score
The player's final score as a float.
SDKVersionShort
Gets the version of the Skillz SDK your game is being run on.
public static string SDKVersionShort();
Returns
The Skillz SDK's version as a string.
GetPlayer
Gets information about the player.
public static SkillzSDK.Player GetPlayer();
Returns
A Player
instance.
SkillzCrossPlatform.Random
Value
Use the Skillz random implementation to ensure each competitor recieves the exact same random number.
SkillCrossPlatform.Random.Value()
InsideUnitSphere
Find a point inside the unit sphere using Value()
.
public static Vector3 InsideUnitSphere();
InsideUnitCircle
Find a point inside the unit circle using Value()
.
public static Vector2 InsideUnitCircle();
OnUnitSphere
Hybrid rejection / trig method to generate points on a sphere using Value()
.
public static Vector3 OnUnitSphere();
RotationUniform
Quaternion random using Value()
.
public static Quaternion RotationUniform();
Rotation
Quaternion random using Value()
.
public static Quaternion Rotation();
Range
Ranged random using Value()
. This method is overloaded.
public static float Range(float min, float max);
public static int Range(int min, int max);
Parameters
min
The minimum value.
max
The maximum value.
Returns
The random value in between min
and max
, inclusive.
Player
Property | Data Type | Description |
---|---|---|
DisplayName | string | Player name |
ID | UInt64? | The unique ID for this match |
TournamentPlayerID | UInt64? | A Tournament Player ID unique to this user. |
AvatarURL | string | A link to the user's avatar image. |
FlagURL | string | A link to the user's country's flag image. |
IsCurrentPlayer | bool | This Player represents the current user if this is true. |
Match
Property | Data Type | Description |
---|---|---|
IsCustomSynchronousMatch | bool | Indicates if the match is a sync match |
Name | string | Name of the match |
Description | string | The description of this tournament type |
ID | ulong? | The unique ID for the match |
TemplateID | int? | The unique ID for the tournament template this match is based on |
SkillzDifficulty | uint? | The difficulty of the game (used with automatic difficulty). Note: only set in production. |
IsCash | bool | Indicates the match is for real prizes or for Z |
EntryPoints | int? | If this tournament is being played for Z, this is the amount of Z required to enter. |
EntryCash | float? | If this tournament is being played for real cash, this is the amount of cash required to enter. |
IsSynchronous | bool | Deprecated. Indicates if this match is Async or Sync. Note: please use the IsCustomSynchronousMatch property to verify if the match is sync. |
Players | List | List of players in the match |
CustomServerConnectionInfo | CustomServerConnectionInfo | The connection info to a custom server that coordinates a real-time match. |
GameParams | Dictionary<string, string> | The custom parameters for this tournament type |
CustomServerConnectionInfo
Property | Data Type | Description |
---|---|---|
MatchId | string | The ID of the real-time match |
ServerIp | string | The hostname or IP for the match |
ServerPort | string | The port for the game server |
MatchToken | string | An encrypted token to help validate the session server side |
Interfaces
SkillzMatchDelegate
Implement this interface to be notified when an asynchronous match is about to begin, and for other events of interest.
OnMatchWillBegin
Called when an asynchronous match is about to begin.
void OnMatchWillBegin(Match matchInfo);
Parameters
matchInfo
A Match
object containing info about the match.
OnSkillzWillExit
Called when the Skillz UI is exiting via the sidebar menu.
void OnSkillzWillExit();