Search Unity

Daily (Time Based) Rewards - Increase your retention

Discussion in 'Assets and Asset Store' started by GleyGames, Feb 14, 2020.

  1. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Daily (Time Based) Rewards
    Increase your retention
    DailyReward_1200x630.png

    Get if from Asset Store - Daily (Time Based) Rewards
    For detailed implementation instructions see the Documentation

    Key Features:

    • Increase the retention of your game by using Daily Rewards and Time Based rewards.
    • Contains Timer buttons and Calendar popup rewards.
    • Easy to use and display with a single line of code.
    • Automatically adjusts resolution for both Landscape and Portrait mode.
    • All setup is done in a Settings Window.
    • Supports any number of days.
    • Customizable time between consecutive rewards.
    • First day can be open or not by default, based on settings.
    • Full commented code, popups and demo scenes included.
    • Works with Unity 2017.1 and above with Free, Plus or Pro license.
    • Works on all supported Unity platforms.
    Easy setup from a Custom Editor Window:
    SettingsWindow.jpg
    SettingsWindow-2.jpg

    Works in portrait and landscape mode:

    CalendarPortret.jpg
    Example2-Calendar.jpg
    Calendar implementation example:
    Code (CSharp):
    1. public class CalendarExample : MonoBehaviour
    2. {
    3.     public Text UIRewardText;
    4.     int reward;
    5.  
    6.     void Start()
    7.     {
    8.         //uncomment this to clear your save
    9.         //PlayerPrefs.DeleteAll();
    10.  
    11.         //You can add this listener anywhere in your code
    12.         //and your method will be called every time a Day Button is clicked
    13.         GleyDailyRewards.Calendar.AddClickListener(CalandarButtonClicked);
    14.     }
    15.  
    16.     /// <summary>
    17.     /// Triggered every time a day button is clicked
    18.     /// </summary>
    19.     /// <param name="dayNumber">current clicked day</param>
    20.     /// <param name="rewardValue">the reward value for current day</param>
    21.     /// <param name="rewardSprite">the sprite of the reward</param>
    22.     private void CalandarButtonClicked(int dayNumber, int rewardValue, Sprite rewardSprite)
    23.     {
    24.         Debug.Log("Click " + dayNumber + " " + rewardValue);
    25.         reward += rewardValue;
    26.         UIRewardText.text = reward.ToString();
    27.     }
    28.  
    29.  
    30.     public void ShowCalendar()
    31.     {
    32.         //call this method anywhere in your code to open the Calendar Popup
    33.         GleyDailyRewards.Calendar.Show();
    34.     }
    35. }
    Timer button implementation example:
    Code (CSharp):
    1. public class TimerButtonExample : MonoBehaviour
    2. {
    3.     void Start()
    4.     {
    5.         //You can add this listener anywhere in your code and your method will be called every time a TimerButton is clicked
    6.         GleyDailyRewards.TimerButton.AddClickListener(RewardButtonClicked);
    7.     }
    8.  
    9.  
    10.     /// <summary>
    11.     /// Triggered every time a timer button is clicked
    12.     /// </summary>
    13.     /// <param name="buttonID">the ID of the clicked button - was set up inside settings window</param>
    14.     /// <param name="timeExpired">true if time expired</param>
    15.     private void RewardButtonClicked(TimerButtonIDs buttonID, bool timeExpired)
    16.     {
    17.         Debug.Log(buttonID + " Clicked -> Time expired: " + timeExpired);
    18.        
    19.         if(timeExpired)
    20.         {
    21.             Debug.Log("give the reward");
    22.             //if(buttonID == RewardButtonIDs.YourButtonID)
    23.             //{
    24.                     //give reward for this button ID
    25.             //}
    26.         }
    27.         else
    28.         {
    29.             //not ready yet, you have to wait
    30.             Debug.Log("Wait " + GleyDailyRewards.TimerButton.GetRemainingTime(buttonID));
    31.         }
    32.     }
    33. }
    Also we made some video tutorials to help you:

     
  2. CF-Games

    CF-Games

    Joined:
    Jun 2, 2013
    Posts:
    134
    Hello,

    I was looking for a daily reward asset and was wondering what's the difference between this and Daily Rewards? Also, does your asset prevent cheating by using an online clock or does it use the system clock?
     
  3. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,
    I am not the owner of the asset you you linked so I do not know the differences between them.
    And our asset does not users server time. because there are a lot if issues when you are doing that, like what happens if your user turns off his wi-fi, server time is not working anymore, and plays your game.And now it is possible to skip his clock. If a player wants to cheat it will.
    As an example even Candy Crash and all other games of that series made by Facebook are not using server clock, not because it cannot be done, because it is not worth implement it.

    We have complete tutorials that are covering the functionality of our asset that are available and also the complete documentation is available. You can watch them and decide yourself if our asset is better or not, and buy the one that is the best for you.

    If you need more info let me know.
     
  4. gamebox777

    gamebox777

    Joined:
    Nov 12, 2012
    Posts:
    5
    Is it possible to add rewards from the script?
    This is because we want to add the next reward when we get the reward.
     
  5. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,
    Please elaborate more about your question because it is not clear. You want to dynamically update your calendar from script?
     
  6. kandelaki_L

    kandelaki_L

    Joined:
    Jun 5, 2018
    Posts:
    8
    Hello,
    I want to make a life timer. I have 3 lives and need 30 minutes to rebuild each.
    I think the easiest way to do this is to add 30 minutes to the timer for each life spent.
    How can I realize this?
    How can I add time to the timer as I needed?
    I mean -- Gley > Daily rewards > Timer button setup > Time to pass + 30 minutes
    Thank you
     

    Attached Files:

  7. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello,
    Currently that is not possible but I will make an update to the plugin this week to support that
     
    kandelaki_L likes this.
  8. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    The following 2 methods ware added to the plugin and they will be available in version 1.3.0 that awaits for Asset Store approval.

    Add the amount of time to the specified button GleyDailyRewards.TimerButton.AddTime(TimerButtonIDs.ButtonID, new TimeSpan(0, 1, 0));

    Remove the amount of time from the specified button GleyDailyRewards.TimerButton.RemoveTime(TimerButtonIDs.ButtonID, new TimeSpan(0, 1, 0));
     
    kandelaki_L likes this.
  9. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
  10. kandelaki_L

    kandelaki_L

    Joined:
    Jun 5, 2018
    Posts:
    8
    Thank you!
     
    GleyGames likes this.
  11. omontor

    omontor

    Joined:
    Aug 27, 2015
    Posts:
    1
    Hello!
    I just bought your asset and it works great, however I have one question regarding the reward button.
    Is there a way to find out how many times the specified time has passed?
    For example:

    I want my user to get a new life every 30 min. I have created the corresponding button and made it automatically clicked when the time passes. But if my user comes back 2 hours later instead of getting 4 lives (since the time has passed 4 times), they would only get 1, how can I find out this value?

    Thank you, best regards.
     
  12. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    The obvious reason is to let your user click the button by himself and he will get his life when he clicks, then the timer will start again, so your user will not get only one life using this method.
    If for some reason that is not a solution for you, every time you automatically click the button, increment an int variable, that will count your clicks.
     
  13. Nihil688

    Nihil688

    Joined:
    Mar 12, 2013
    Posts:
    503
    if you rewrote it to support that, do share! :D
     
  14. awais133121

    awais133121

    Joined:
    Apr 5, 2016
    Posts:
    2
    hi, I wanna know how to show Daily rewards popup auto when daily reward is ready instead of click on any button by user. I should be automatically shows to player when he/she starts the game if daily reward is ready it will be show on game startup automatically. Please tell me how can I do this. There is no any function to check out if reward is ready or not. Thanks!
     
  15. GleyGames

    GleyGames

    Joined:
    Oct 16, 2015
    Posts:
    482
    Hello!
    If you want to show the Daily reward popup automatically you show call the method ShowCalendar(); wherever in your code. In my example I envisioned it to be triggered by a button click. Moreover, you can check the time remained from the CalendarPopup.cs and condition the opening depending on that.

    For the current implemetation, I did not envisioned such functions because these are particular cases, but you can do it having my guidance above. I hope it helped!