-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Included Unity Package definition #7
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,13 +8,28 @@ If you are looking for a .Net implementation that you can also use in Unity you | |
## Usage | ||
Simply add the .cs file to your project. | ||
|
||
OR | ||
|
||
Include this repository as a package: | ||
- In Unity 2021+ | ||
1. Open the Package Manager (Window -> Package Manager). | ||
2. Click the plus sign button ("+") and select "Add package from git URL..." | ||
3. Enter the URL of this repository and click "Add". | ||
- In previous versions, add the following line to your Packages/manifest.json file under dependencies: | ||
|
||
``` | ||
"io.gitstats.unity": "URL of this repo" | ||
``` | ||
To get the URL of this repository to use in any of the options above, click on the green "Code" button at the top of this page, then copy the HTTPS URL. | ||
### Submitting Scores | ||
To submit a player score instatiante a object, add the values and call Share() | ||
To submit a player score instantiate a object, add the values and call Share() | ||
``` | ||
private const string GlobalstatsIOApiId = "YourApiIdHere"; | ||
private const string GlobalstatsIOApiSecret = "YourApiSecretHere"; | ||
|
||
GlobalstatsIO gs = new GlobalstatsIO(GlobalstatsIOApiId, GlobalstatsIOApiSecret); | ||
var gs = new GlobalstatsIOClient(GlobalstatsIOApiId, GlobalstatsIOApiSecret); | ||
|
||
string user_name = "Nickname"; | ||
|
||
|
@@ -66,7 +81,7 @@ void CallbackMethod(bool success){ | |
``` | ||
Of course, this will use the data from the prior share() call for linking. | ||
### Retrieving Leaderboard | ||
### Retrieving Leaderboard | ||
You can also fetch the current top positions of your leaderboard with a GTD of your choice. You can retrieve that leaderboard with following lines: | ||
``` | ||
|
@@ -86,7 +101,7 @@ void CallbackMethod(Leaderboard leaderboard){ | |
} | ||
``` | ||
In this case we want the leaderboard of the GTD score. The limit is the number players you want to fetch, which has to be between 1 and 100. | ||
In this case we want the leaderboard of the GTD score. The limit is the number players you want to fetch, which has to be between 1 and 100. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the number of players you want to fetch... |
||
## Feedback | ||
If you encounter any issues you can create an issue here on github. | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "io.globalstats.unity", | ||
"rootNamespace": "", | ||
"references": [], | ||
"includePlatforms": [], | ||
"excludePlatforms": [], | ||
"allowUnsafeCode": false, | ||
"overrideReferences": false, | ||
"precompiledReferences": [], | ||
"autoReferenced": true, | ||
"defineConstraints": [], | ||
"versionDefines": [], | ||
"noEngineReferences": false | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "io.globalstats.unity", | ||
"version": "1.0.0", | ||
"displayName": "GlobalStats", | ||
"description": "The integration of the globalstats.io API into a library for unity", | ||
"unity": "2018.4", | ||
"author": { | ||
"name": "globalstats.io", | ||
"email": "[email protected]", | ||
"url": "https://globalstats.io/" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instantiate an object