Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

elringus/unity-donation-alerts

Repository files navigation

Description

A client for DonationAlerts streaming platform, allowing to send and receive events (such as donation alerts) within Unity game engine.

Installation

Download and import UnityDonationAlerts.unitypackage package.

How to use

After installing the package, go to project settings (Edit -> Project Settings) and select DonationAlerts category.

Click "Create DonationAlerts API app" and register a new app to get unique application ID and API key and enter them in the settings. Other fields can be left as is.

Now you can listen events in Unity, eg:

private void OnEnable ()
{
    DonationAlerts.Connect();
    DonationAlerts.OnDonation += HandleDonation;
}

private void OnDisable ()
{
    DonationAlerts.Disconnect();
    DonationAlerts.OnDonation -= HandleDonation;
}

private void HandleDonation (Donation donation)
{
    Debug.Log($"From: {donation.From} Message: {donation.Message} Amount: {donation.Amount}");
}

To send a test donation use "My Messages -> Add Message" (enable show in widget toggle) on DonationAlerts dashboard: https://www.donationalerts.com/dashboard/donations

About

DonationAlerts SDK for Unity game engine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages