Set a custom reward function which will run after an achievement’s reward is rolled.
1
2
3
4
5
6
systems.GetAchievementsSystem().SetOnAchievementReward(OnAchievementReward)funcOnAchievementReward(ctxcontext.Context,loggerruntime.Logger,nkruntime.NakamaModule,userID,sourceIDstring,source*hiro.AchievementsConfigAchievement,rewardConfig*hiro.EconomyConfigReward,reward*hiro.Reward)(*hiro.Reward,error){// Modify reward or take additional actions.
returnreward,nil}
Set a custom reward function which will run after a sub-achievement’s reward is rolled.
1
2
3
4
5
6
systems.GetAchievementsSystem().SetOnSubAchievementReward(OnSubAchievementReward)funcOnSubAchievementReward(ctxcontext.Context,loggerruntime.Logger,nkruntime.NakamaModule,userID,sourceIDstring,source*hiro.AchievementsConfigSubAchievement,rewardConfig*hiro.EconomyConfigReward,reward*hiro.Reward)(*hiro.Reward,error){// Modify reward or take additional actions.
returnreward,nil}
Set a custom reward function which will run after an achievement’s total reward is rolled.
1
2
3
4
5
6
systems.GetAchievementsSystem().SetOnAchievementTotalReward(OnAchievementTotalReward)funcOnAchievementTotalReward(ctxcontext.Context,loggerruntime.Logger,nkruntime.NakamaModule,userID,sourceIDstring,source*hiro.AchievementsConfigAchievement,rewardConfig*hiro.EconomyConfigReward,reward*hiro.Reward)(*hiro.Reward,error){// Modify reward or take additional actions.
returnreward,nil}