Skip to content
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

Merged
merged 2 commits into from
Oct 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions GlobalstatsIO.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 19 additions & 4 deletions README.md
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()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instantiate an object

```
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.
Copy link
Contributor

Choose a reason for hiding this comment

The 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.
7 changes: 7 additions & 0 deletions README.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions io.globalstats.unity.asmdef
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
}
7 changes: 7 additions & 0 deletions io.globalstats.unity.asmdef.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions package.json
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/"
}
}
7 changes: 7 additions & 0 deletions package.json.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.