2d-pixel-perfect
Sets up, diagnoses, and fixes pixel perfect 2D rendering with PixelPerfectCamera in URP or Built-in. Use when a retro-style or…
Implements, configures, and debugs Unity In-App Purchases, including subscriptions, receipt validation, and direct-to-customer payments via Stripe or Coda. Use when asked about real-money purchases or microtransactions, or migrating from native store billing, RevenueCat, Adapty,
$ npx -y skills add unity-technologies/skills --skill implement-in-app-purchases --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/implement-in-app-purchasesContext preview
The summary Claude sees to decide when to auto-load this skill.
Implements, configures, and debugs Unity In-App Purchases, including subscriptions, receipt validation, and direct-to-customer payments via Stripe or Coda. Use when asked about real-money purchases or microtransactions, or migrating from native store billing, RevenueCat, Adapty,
name: implement-in-app-purchases description: Implements, configures, and debugs Unity In-App Purchases, including subscriptions, receipt validation, and direct-to-customer payments via Stripe or Coda. Use when asked about real-money purchases or microtransactions, or migrating from native store billing, RevenueCat, Adapty, Essential Kit, or UniPay.
Namespace: `UnityEngine.Purchasing` | Security: `UnityEngine.Purchasing.Security` Package: `com.unity.purchasing`
**Unity IAP has its own initialization path** via `UnityIAPServices.StoreController()` → `store.Connect()`. It does not require `UnityServices.InitializeAsync()`, but they can coexist if your project uses other UGS services. If Analytics is present and `InitializeAsync()` is called, IAP will automatically send transaction events.
**Always read [references/pre-check.md](references/pre-check.md) first.** It scans the project for third-party IAP packages, native Google Billing, and existing Unity IAP versions, then routes to the correct path. Do not read any other reference file or make any changes until routing is resolved.
Read reference files on demand — only when you need specific API signatures, platform extension details, or migration mappings.
1. Obtain `StoreController` via `UnityIAPServices.StoreController()` (or individual services via `DefaultStore()`, `DefaultProduct()`, `DefaultPurchase()`) 2. Subscribe to **all** required events (see Required Event Subscriptions below) **before** calling `Connect()` 3. `await store.Connect()` to connect to the platform store 4. On `OnStoreConnected`, call `store.FetchProducts(List<ProductDefinition>)` to load the catalog 5. On `OnProductsFetched`, products are ready for display and purchase
Use `Awake()` for initialization — ensures IAP is ready before other `Start()` methods.
Product types: `ProductType.Consumable`, `ProductType.NonConsumable`, `ProductType.Subscription`.
Define products as `List<ProductDefinition>` and pass to `store.FetchProducts()`. Use `StoreSpecificIds` when product IDs differ across Apple/Google stores. For complex catalogs, use `CatalogProvider` to manage product sets and store-specific IDs.
| Method | Behavior | |---|---| | `GetProducts()` | Returns the **cached** product list (synchronous, stale if `FetchProducts` not called) | | `FetchProducts()` | Queries the **store** for fresh pricing/availability and updates the cache | | `GetProductById(id)` | Returns a single cached product by ID |
These are NOT interchangeable. Always call `FetchProducts()` first before relying on `GetProducts()`.
IAP v5 uses a mandatory two-step flow: **Pending → Confirm**.
1. `store.PurchaseProduct(product)` — initiates the platform purchase dialog 2. `OnPurchasePending` fires — you receive a `PendingOrder` 3. Validate the receipt, grant content to the player 4. `store.ConfirmPurchase(pendingOrder)` — finalizes the transaction 5. `OnPurchaseConfirmed` fires — receives `Order` base type; pattern-match `ConfirmedOrder` (success) vs `FailedOrder` (confirmation failed)
**You MUST call `ConfirmPurchase(pendingOrder)` after granting content.** Unconfirmed purchases are re-delivered on next app launch to prevent lost purchases.
**De-duplication:** `OnPurchasePending` may fire multiple times for the same purchase (e.g., app restart before confirmation). Always check if content was already granted.
**Consumables:** Confirmed consumable purchases are NOT returned by `FetchPurchases`. Track consumable grants yourself (e.g., in Cloud Save or Economy).
**Deferred purchases:** `OnPurchaseDeferred` fires for Ask-to-Buy (iOS) and Google Play deferred purchases. Do NOT grant content — wait for `OnPurchasePending` when approved.
`store.RestoreTransactions(callback)` re-delivers non-consumable and subscription purchases. Each restored purchase triggers `OnPurchasePending`.
Required on iOS for Apple App Store compliance — add a "Restore Purchases" button.
Apple non-renewable subscriptions **cannot be restored** via `RestoreTransactions`. Track these server-side.
| Platform | Approach | |---|---| | **Google Play** | `CrossPlatformValidat
A collection of reusable AI agent skills for Unity workflows. Compatible with Claude Code, GitHub Copilot, Cursor, Cline, and 50+ other agents.
Sets up, diagnoses, and fixes pixel perfect 2D rendering with PixelPerfectCamera in URP or Built-in. Use when a retro-style or…
Imports 3D models and point clouds with Asset Transformer Toolkit (formerly Pixyz), and creates, edits, and runs RuleSets,…
Routes Audio Sources into existing Audio Mixer Groups, classifying each source by what it plays. Use when the user asks about…
Builds node-based Editor tools with Unity Graph Toolkit (GTK) on Unity 6.6+: graphs, nodes, ports and validation, State Machine…
Builds and operates live games with Unity Services. Use when the user asks about backend or live-ops features such as player…
Creates and fixes Unity 2D physics in both systems, 2D Physics Core and the legacy Rigidbody 2D system. Use when the user asks…