From 0bc96b223cb816bc7fb64c8e0f6589fd46f7a109 Mon Sep 17 00:00:00 2001 From: Ed Date: Thu, 22 Apr 2021 18:28:59 -0700 Subject: [PATCH 1/2] Added Unity package definition. --- GlobalstatsIO.cs.meta | 11 +++++++++++ README.md.meta | 7 +++++++ io.globalstats.unity.asmdef | 14 ++++++++++++++ io.globalstats.unity.asmdef.meta | 7 +++++++ package.json | 12 ++++++++++++ package.json.meta | 7 +++++++ 6 files changed, 58 insertions(+) create mode 100644 GlobalstatsIO.cs.meta create mode 100644 README.md.meta create mode 100644 io.globalstats.unity.asmdef create mode 100644 io.globalstats.unity.asmdef.meta create mode 100644 package.json create mode 100644 package.json.meta diff --git a/GlobalstatsIO.cs.meta b/GlobalstatsIO.cs.meta new file mode 100644 index 0000000..750f209 --- /dev/null +++ b/GlobalstatsIO.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9c2dead7ebb8c73419d370c3448c3484 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/README.md.meta b/README.md.meta new file mode 100644 index 0000000..1e1a586 --- /dev/null +++ b/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4d2a9fbc819168c44ab5a5fdcebb8999 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/io.globalstats.unity.asmdef b/io.globalstats.unity.asmdef new file mode 100644 index 0000000..273c747 --- /dev/null +++ b/io.globalstats.unity.asmdef @@ -0,0 +1,14 @@ +{ + "name": "io.globalstats.unity", + "rootNamespace": "", + "references": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/io.globalstats.unity.asmdef.meta b/io.globalstats.unity.asmdef.meta new file mode 100644 index 0000000..f0ab4a3 --- /dev/null +++ b/io.globalstats.unity.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: deff98c6e4262274794bb4bd6d5c6887 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/package.json b/package.json new file mode 100644 index 0000000..44ba2c1 --- /dev/null +++ b/package.json @@ -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": "feedback@globalstats.io", + "url": "https://globalstats.io/" + } +} \ No newline at end of file diff --git a/package.json.meta b/package.json.meta new file mode 100644 index 0000000..75c5761 --- /dev/null +++ b/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9ef87eb9f3b21c842a38e6b5982a706a +PackageManifestImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From d8fc65e79c43c1fe7192f24c0fbc18cfecccf5b8 Mon Sep 17 00:00:00 2001 From: Ed Date: Thu, 22 Apr 2021 20:46:38 -0700 Subject: [PATCH 2/2] Updated README file --- README.md | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9e56a35..f6e71fd 100644 --- a/README.md +++ b/README.md @@ -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. ## Feedback If you encounter any issues you can create an issue here on github.