v1.0.0
- Attach a
Scoreboard
component to aGameObject
. - Set its API Key and Secret. You can get these values from your game's page on The Winnitron Network.
HighScore score = new HighScore("Jim", 1000);
scoreboard.Send(score, SuccessHandler);
public object SuccessHandler(object created) {
// created is an instance of HighScore
// The world is your oyster.
}
// top five scores on the Winnitron being played RIGHT NOW
scoreboard.Get(5, Scoreboard.THIS_WINNITRON, SuccessHandler);
// top ten scores across the entire Winnitron Network
scoreboard.Get(10, Scoreboard.ALL_WINNITRONS, SuccessHandler);
// top twenty scores on the Winnitron 1000
scoreboard.Get(20, "winnitron-1000", SuccessHandler);
public object SuccessHandler(object results) {
HighScore[] scoreList = (HighScore[]) results;
// ...
}
If something goes awry - for example, the Winnitron your game is running on loses its network connection, or if the data you send is incomplete/invalid, the above methods will throw a Winnitron.NetworkException
.
Fetching high scores in test mode will only return scores that were also created in test mode.
https://github.com/winnitron/WinnitronHighScoreUnity
All the myriad ways you can find us on the information superhighway: