https://github.com/kongregate/kongregate-web
Bindings to the Kongregate JavaScript API for Unity: https://kongregate.github.io/kongregate-web/
https://github.com/kongregate/kongregate-web
api csharp javascript kongregate unity unity3d web
Last synced: 3 months ago
JSON representation
Bindings to the Kongregate JavaScript API for Unity: https://kongregate.github.io/kongregate-web/
- Host: GitHub
- URL: https://github.com/kongregate/kongregate-web
- Owner: kongregate
- License: mit
- Created: 2019-04-05T20:22:33.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-11-23T06:29:13.000Z (7 months ago)
- Last Synced: 2025-03-26T00:51:19.637Z (3 months ago)
- Topics: api, csharp, javascript, kongregate, unity, unity3d, web
- Language: C#
- Homepage:
- Size: 488 KB
- Stars: 3
- Watchers: 9
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Kongregate Web API for Unity
 [](https://openupm.com/packages/com.kongregate.kongregate-web/)   [](https://kongregate.github.io/kongregate-web/api/)
This package provides C# bindings to the [Kongregate Web API](https://docs.kongregate.com/v1.0/reference) to be used in developing Unity games that will be published on the Kongregate website.
**[Usage and API documentation](https://kongregate.github.io/kongregate-web/api/)**
```csharp
KongregateWeb.BecameReady += () =>
{
if (KongregateWeb.IsGuest)
{
Debug.Log("Player is a guest");
}
else
{
Debug.Log("Player is logged in as " + KongregateWeb.Username);
}
};KongregateWeb.LoggedIn += () =>
{
Debug.Log("Player is logged in as " + KongregateWeb.Username);
};
```## Setup and Usage
To include kongregate-web as a Unity package, you'll need to be on Unity 2018.3 or later. kongregate-web is [hosted on OpenUPM](https://openupm.com/packages/com.kongregate.kongregate-web/). Follow the [OpenUPM getting started guide](https://openupm.com/docs/getting-started.html) if you're not already using it, then run the following command from within your Unity project:
```text
openupm add com.kongregate.kongregate-web
```> Alternate setup instructions are also available [on the docs site](https://kongregate.github.io/kongregate-web/#setup).
Once you have added the package to your project you'll also need to [setup a custom WebGL template](https://kongregate.github.io/kongregate-web/#setup-custom-webgl-template) to make the Kongregate JavaScript API available to your game.