기술 자료

Unity Engine


User Manual

Script Reference

Unity Engine


Prepare your project to support in-app purchases for XBOX on Windows

Install required packages, set up add-ons in Microsoft Partner Center, and configure Unity Editor settings before implementing in-app purchases.
읽는 시간 3분최근 업데이트: 23일 전

Install the required Unity packages, create add-ons in Microsoft Partner Center, and configure Unity Editor settings to prepare your Unity project for XBOX Store purchases.

Prerequisites

Before you implement in-app purchases, verify your project meets the following requirements:
Development environment:
Unity packages:
Install the following packages:

1. Configure Microsoft Partner Center

Before implementing in-app purchases, verify the following configurations in Microsoft Partner Center:
  • Title ID or Service Configuration ID
  • Device families selected for publishing
  • Sandbox configured with test accounts
For more information, refer to the Microsoft documentation on Product setup.
참고
Sandbox environments don't support subscription testing. Subscriptions don't display in XBOX account settings, which prevents renewal or cancellation.

Enable Microsoft Store Services (Optional)

To enable Microsoft Store Services, go to Product collections and purchases, and enter the client ID of your game back end.

Create add-ons for Unity IAP

Add-ons represent the products you want to sell in your game.
  1. Go to Add-ons and create add-ons that match the product types in the IAP package.

    IAP ProductType

    Microsoft Partner Center Add-on

    XStoreProductKind

    ConsumableConsumable (Developer-managed)UnmanagedConsumable
    Non-ConsumableDurableDurable
    SubscriptionSubscriptionDurable (EndDate property is set)
    참고
    The
    XStoreProductKind
    is included for reference only. Use the
    ProductType
    enum in your Unity code.
  2. For each add-on, configure the following settings:
    • Content type: Electronic software download
    • Microsoft Store listing: Doesn’t have its own Microsoft Store listing
  3. In the Identity details section, note the Store ID for each add-on.

2. Configure Unity Editor settings

Configure Microsoft GDK packages and enable Unity IAP to prepare your project for XBOX Store integration.

Set up GDK packages

  1. In the Unity Editor, go to
    Project Settings

    ?

    > Microsoft GDK and enable Build for Microsoft GDK for each target platform.
  2. Ensure a GDK Settings asset is active, and configure the Microsoft Game Config asset with IDs that match the ones in Microsoft Partner Center.
  3. Go to Project Settings > Player > Other Settings and verify that the Scripting Define Symbols includes
    MICROSOFT_GDK_SUPPORT
    .
    참고
    This symbol is set automatically when you enable Build for Microsoft GDK in Project Settings > Microsoft GDK.

Set up IAP package

  1. Enable and configure the IAP service for your project. For more information, refer to the IAP package documentation on Get started with Unity IAP.
  2. Verify if the current targeted store is XBOX Store.
After completing the Microsoft Partner Center and Unity Editor configuration, implement the purchase workflow in your Unity code.

Additional resources