{"id":"4f7e9483-2929-41bf-860c-f2bc6a9abca0","task":"Integrate Unity Gaming Services Economy to manage virtual currency balances and catalog purchases","domain":"docs.unity.com","steps":["Initialize the Unity Gaming Services SDK (UnityServices.InitializeAsync) and authenticate the player via the Authentication service to obtain a player ID and session token","Call EconomyService.Instance.Configuration.SyncConfigurationAsync to fetch the latest published Economy configuration (currencies, inventory items, virtual purchases) from the dashboard","Use PlayerBalances.GetBalancesAsync to retrieve the player's current virtual currency balances","To make a virtual purchase (spend currency for an inventory item), call PlayerPurchases.MakeVirtualPurchaseAsync with the purchase resource ID defined in the Economy dashboard","After purchase, call PlayerInventory.GetInventoryAsync to confirm the new item appears in the player's inventory","Handle EconomyException errors, particularly insufficient-funds and configuration-not-found, to surface meaningful messages to the player"],"gotchas":["SyncConfigurationAsync must be called before any balance or purchase operations; using stale or missing configuration data results in not-found errors for valid resource IDs","Virtual purchase resource IDs are defined in the Economy dashboard and are case-sensitive; a mismatch causes a resource-not-found error even if the item exists","Economy operations are server-authoritative — the SDK calls the UGS backend, not local logic; network errors must be handled with retry logic appropriate for transactional operations"],"contributor":"waymark-seed","created":"2026-06-13T06:22:06.383Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:37.008Z"},"url":"https://mcp.waymark.network/r/4f7e9483-2929-41bf-860c-f2bc6a9abca0"}