You can listen for changes in the incentive system so that you can respond appropriately, such as updating the UI, by implementing the IObserver pattern, or use the SystemObserver<T> type which handles it for you.
1
2
3
4
5
vardisposer=SystemObserver<IncentiveSystem>.Create(incentiveSystem,system=>{Instance.Logger.Info($"System updated.");// Update UI elements etc as necessary here...});
varincentivesList=awaitincentiveSystem.SenderListAsync();foreach(varincentiveinincentivesList){foreach(var(key,value)inincentive.Claims){Debug.Log($"{key} claimed at {value.ClaimTimeSec}.");}foreach(varuserIdinincentive.UnclaimedRecipients){Debug.Log($"{userId} has not yet claimed.");}}
varincentiveId="<incentiveId>";varincentive=awaitincentiveSystem.SenderCreateAsync(incentiveId);Debug.Log($"Created incentive with code: {incentive.Code}");