In many video games, a daily bonus is a reward that a player can receive for logging in to the game daily. The daily bonus can take many forms, such as in-game currency, items, or special perks. The purpose of the daily bonus is to encourage players to log in to the game regularly and keep playing. Some games may offer a different daily bonus each day to keep things interesting for players.
- Open the Daily Bonus section.
- Add at least one Daily Bonus document. You can have multiple Daily Bonuses for different segments of your players for testing, or you can change them during the players' progress in your game.
Daily Bonus parameters¶
|Name||The name of the bonus it's used for your convenience only.|
|Condition||You can set up specific conditions for Daily Bonus to activate. For example, you can launch Daily Bonus only after the tutorial.|
|Type||Determines how Daily Bonus resets. CollectAllToReset - resets when you collect all the rewards, SkipToReset - resets when you collect all the rewards or skip a day, CalendarReset - resets only when the new month starts.|
|Rewards||The list of all the daily rewards. Each daily reward can contain multiple items.|
|Bonus Reward||It's mostly used with CalendarReset type of bonuses. Players will get the Bonus Reward every day when all the rewards are collected until the new month starts.|
Section for programmers¶
Use the following methods to work with Daily Bonus
//Returns the list of all the rewards with statuses Balancy.LiveOps.DailyBonus.GetAllRewards(); //Returns the next Reward Balancy.LiveOps.DailyBonus.GetNextReward(); //Returns the next Reward number, starting from 1 Balancy.LiveOps.DailyBonus.GetNextRewardNumber(); //Returns true if you can claim the next reward Balancy.LiveOps.DailyBonus.CanClaimNextReward(); //Returns the number of seconds till the next reward. 0 - the reward is already available, -1 - something went wrong with the dates. Balancy.LiveOps.DailyBonus.GetSecondsTillTheNextReward(); //Claims the next available reward and returns its value Balancy.LiveOps.DailyBonus.ClaimNextReward(); //Returns true if the next reward is the Bonus Reward Balancy.LiveOps.DailyBonus.IsNextRewardBonus();
You can also subscribe the listener for LiveOps DailyBonus to receive events when the next Daily Bonus is available. It'll be triggered when you start the game or if the day will change during the session.
//Don't forget to create your own implementation of LiveOpsEventsExample ExternalEvents.RegisterLiveOpsListener(new LiveOpsEventsExample());