This package provides C# bindings to the Kongregate Web API to be used in developing Unity games that will be published on the Kongregate website.
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);
};
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. Follow the OpenUPM getting started guide if you're not already using it, then run the following command from within your Unity project:
openupm add com.kongregate.kongregate-web
Alternate setup instructions are also available on the docs site.
Once you have added the package to your project you'll also need to setup a custom WebGL template to make the Kongregate JavaScript API available to your game.