private void RefreshUI() { var coinBalance = GameFoundationSdk.wallet.Get(m_CoinDefinition); coinUiValue.text = coinBalance.ToString(); _persistenceDataLayer.Save(); }
public void Save(Action onComplete) { var saveOperation = _dataLayer.Save(); if (saveOperation.isDone) { LogSaveOperationCompletion(saveOperation); } else { StartCoroutine(WaitForSaveCompletion(saveOperation, onComplete)); } }
/// <summary> /// START of Save/Load methods /// </summary> public void Save() { // Deferred is a struct that helps you track the progress of an asynchronous operation of Game Foundation. Deferred saveOperation = mDataLayer.Save(); // Check if the operation is already done. if (saveOperation.isDone) { LogSaveOperationCompletion(saveOperation); } else { StartCoroutine(WaitForSaveCompletion(saveOperation)); } }
/// <summary> /// This method adds coins to the wallet. /// Note: Because changes to Wallet trigger callback events, we do NOT need to add additional /// processing to detect the change nor update UI here. /// </summary> public void FindCoins() { GameFoundationSdk.wallet.Add(m_CoinDefinition, k_FindQuantity); _persistenceDataLayer.Save(); }