Skip to content
With the GameOn Unity Starter Kit, Unity game developers can easily test out all the endpoints that GameOn Game API provides before even integrating them in their game client. It also provides an avenue for us to showcase best practices while calling the GameOn API.
Branch: master
Clone or download
Latest commit 595e4f1 Mar 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Initial commit Mar 15, 2019
Assets Initial commit Mar 15, 2019
Packages Initial commit Mar 15, 2019
ProjectSettings Initial commit Mar 15, 2019
.gitignore Initial commit Mar 15, 2019
CODE_OF_CONDUCT.md Initial commit Mar 15, 2019
CONTRIBUTING.md Initial commit Mar 15, 2019
LICENSE Initial commit Mar 15, 2019
NOTICE Initial commit Mar 15, 2019
README.md Initial commit Mar 15, 2019
THIRD_PARTY_LICENSES.md Initial commit Mar 15, 2019

README.md

GameOn Unity Starter Kit

With the GameOn Unity Starter Kit, Unity game developers can easily test all the basic endpoints that GameOn Game API provides before even integrating them in their game client.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Latest verison of Unity that can be downloaded from here. This starter kit was tested using Unity 2018.3.8f1.
  • Public API key for the game registered with GameOn. Please follow the instructions here to plug in your first game to GameOn. Please note that while registering the game do not select "Enable advanced security". This starter kit will not work for such games.
  • At least one ongoing competition for the game that you registered above. You can create one from GameOn Console as shown here. If it is your first competition, then you can create it with the default values. Just ensure that competition starts now so that you can see it while running the application.

Setup

  • Download or git clone this repository.

  • Launch Unity, click Open, navigate to the folder where you downloaded the repository and select "gameon-starter-kit-unity" folder.

  • Inside Unity, select "File > Open Scene", navigate to "gameon-starter-kit-unity" folder, and choose "Assets > GameOn > GameOnTest.unity".

  • Select "GameOn" game object under the "GameOnTest" scene and you're ready to run the application.

    .github/images/gameon-game-object-selected-in-unity.png

Run

  • Click the "Play" button at the top to start
  • Enter the public API key for your game (see Prerequisites)
  • Ignore the "Existing Player Token" field for now. We'll revisit it later.
  • Click on "Register New Player" button. This is equivalent of Register Player operation in GameOn API.
  • Once you see "Player Token" field populated under "Current Player Info" section, proceed further.
  • Enter "Player Name". This is optional and if you don't provide it, GameOn will create one for you.
  • Click the "Authenticate Player" button. This corresponds to Authenticate Player operation in GameOn API.
  • Please see the value for "Session Expiration Date". At this time, session will expire and you will have to authenticate this player again. That's where "Player Token" field comes into picture. If you have player token saved somewhere, you can then next time when you run the kit, you can skip "Register Player" by entering "Player Token" and directly proceed for "Authenticate Player".
  • At this point, if you have ongoing competitions, you should see them when you click "Get Tournament List" button. Please refer to this for more details about the "Get Tournaments" operation.
  • Against each tournament that showed up, you will see "Enter Tournament" button. Clicking on this will enter the player that you just authenticated into that tournament. Behind the scene, GameOn finds an open match and enters the player into it. This is considered the first attempt for the player. Details about "Enter Tournament" operation can be found here.
  • Once entered successfully, you can submit score for this player by clicking "Submit Score" button against the tournament. You can find more information about "Submit Score" operation here.
  • On successful score submission, kit calls "Get Leaderboard" operation automatically to get the top 10 scores in the match. This operation support multiple options like finding the rank of the player, getting the top n neighbors etc. For more details, please click here
  • To have player submit score again for the same match, click on "Enter Match" button. This operation allows players to make more than one attempt in a match. For more information, please see this.

This covers all the basic operations that GameOn API provides. For the comprehensive list of operations, please consult the API reference.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

License

This library is licensed under the Apache 2.0 License - see the LICENSE file for details

Acknowledgments

You can’t perform that action at this time.