Set a custom reward function which will run after an energy reward’s value has been rolled.
1
2
3
4
5
6
systems.GetEnergySystem().SetOnSpendReward(OnSpendReward)funcOnSpendReward(ctxcontext.Context,loggerruntime.Logger,nkruntime.NakamaModule,userID,sourceIDstring,source*hiro.EnergyConfigEnergy,rewardConfig*hiro.EconomyConfigReward,reward*hiro.Reward)(*hiro.Reward,error){// Modify reward or take additional actions.
returnreward,nil}