A client for DonationAlerts streaming platform, allowing to send and receive events (such as donation alerts) within Unity game engine.
Download and import UnityDonationAlerts.unitypackage package.
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