Skip to content

winnitron/WinnitronHighScoreUnity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Winnitron High Score Unity Client

v1.0.0

Usage

  • Attach a Scoreboard component to a GameObject.
  • Set its API Key and Secret. You can get these values from your game's page on The Winnitron Network.

Sending a high score

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.
}

Fetching the existing high score list

// 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;
  // ...
}

Error Handling

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.

Test Sandbox

Fetching high scores in test mode will only return scores that were also created in test mode.

Contributing

https://github.com/winnitron/WinnitronHighScoreUnity

Oh god! Send help!

All the myriad ways you can find us on the information superhighway:

http://network.winnitron.com/contact/