Note: Screenshots and menu choices might differ between release versions.
ここでは、 In-App Purchasing (IAP、アプリ内課金) を有効にする方法を説明します。
Unity IAP パッケージには、コード化されたアプローチとコードを使わない方法が用意されており、以下を行うことができます。 - ユーザーがゲーム内でアイテムを購入するのを可能にします。 - ストアに接続することで、購入による収益を得ることができます。
以下は、その手順の概要です。
このゲームのアプリ内課金戦略を定義します。
プロジェクトを Unity のサービスとして設定します。
IAP をアクティベートして、自動的にパッケージをインストールします。
設定を行います。
販売したいゲーム内アイテムを作成し、カタログ化します。
Use the Codeless IAP button to give users a way to buy items. Then, once you have the logic working, consider customizing the button look and feel. Or use the scripted IAP for a rich API to enhance this process.
アプリケーションを、Google、Apple、Android などの関連アプリストアに接続します。
ストアにアイテムを加えます。
すべてをまとめます。
You can also do many of these steps, or fine-tune what you create, with the In-App Purchasing API.
Note: Versions of Unity IAP between 4.2.0 and 4.6.0 automatically install Unity Analytics. Unity Analytics is a paid service, and if your usage exceeds the free tier limits, you will be responsible for paying for your usage. To avoid using Unity Analytics, install Unity IAP 4.7.0 or later, and/or remove Unity Analytics from your project (which you can learn more about here).
Note: The Samsung Galaxy store is now obsolete and is no longer supported in the Unity In-App Purchasing package 4.0.0 and later. This guide to configure the Samsung Galaxy store only applies to the IAP package version 3.1.0 and earlier. If you are using the Unity IAP package 4.0.0 and later and you want to implement a Samsung Galaxy store, use the Unity Distribution Platform instead.
Unity エディターで Unity プロジェクトを開きます。
Window > General > Services を選びます。Services ウィンドウが表示されます。
プロジェクト ID を作成し、そのプロジェクトを組織に接続します。
COPPA のコンプライアンスに関する質問に答えます。
Services ウィンドウには、サービスの一覧が表示されます。In-App Purchasing をクリックします。
Project Settings ウィンドウが表示されます。
Activate the toggle next to In-App Purchasing Settings to ON.
This automatically installs the IAP package from the package manager, providing you with new features and menu items to help you manage IAP.
プレイヤーが購入するアイテムを作り、その ID を取得します。
You must tie product identifiers (strings) to each item you are selling by using a specified format. Some stores require that you customize the Product ID for their stores.
Refer to the Unity Learn IAP classes.
Unity IAP バージョン 2.x から将来のバージョンにアップグレードする場合の重要な注意点
If you are updating from Unity IAP (com.unity.purchasing + the Asset Store plugin) versions 2.x to future versions, to resolve compilation errors, complete the following actions:
IAPProductCatalog.json
と BillingMode.json
を Assets/Plugins/UnityPurchasing/Resources/
から Assets/Resources/
に移動します。AppleTangle.cs
と GooglePlayTangle.cs
を ‘Assets/Plugins/UnityPurchasing/generated’ から Assets/Scripts/UnityPurchasing/generated
へ移動します。Assets/Plugins/UnityPurchasing
に残っている Asset Store プラグインのフォルダーとファイルをすべてプロジェクトから削除します。The following error messages might indicate that Unity IAP is deactivated in the Unity Cloud Services window, or that Unity is disconnected from the Internet:
* CS0246
* System.Reflection.ReflectionTypeLoadException
* UnityPurchasing/Bin/Stores.dll
* UnityEngine.Purchasing
これらのエラーを解決するには、以下を行います。
Reload the Services window by closing, then reopening it. After reloading, ensure that the Unity IAP service is active. If this doesn’t work, try to disconnect and reconnect to the Internet, then sign back into Unity Services and re-activate Unity IAP.
ノート: プロジェクトの 所有者 または 管理者 の役割を持っている必要があります。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.