Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 2 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 (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-11-10T15:40:29.000Z (about 4 years ago)
- Last Synced: 2024-08-02T05:13:37.666Z (5 months ago)
- Topics: api, csharp, javascript, kongregate, unity, unity3d, web
- Language: C#
- Homepage:
- Size: 498 KB
- Stars: 3
- Watchers: 10
- Forks: 4
- 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
![Build and Test](https://github.com/kongregate/kongregate-web/workflows/Build%20and%20Test/badge.svg) [![openupm](https://img.shields.io/npm/v/com.kongregate.kongregate-web?label=openupm®istry_uri=https://package.openupm.com)](https://openupm.com/packages/com.kongregate.kongregate-web/) ![Unity 2019.3](https://img.shields.io/badge/Unity-2019.3-blue) ![Unity 2018.4](https://img.shields.io/badge/Unity-2018.4-blue) [![Latest docs](https://img.shields.io/badge/docs-latest-green)](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.