스토어 구현
Implement the IStore interface to add a custom store to Unity In-App Purchasing.
읽는 시간 1분최근 업데이트: 한 달 전
스토어는 IStore 인터페이스를 구현해야 합니다. 방법은 이어지는 내용에 자세히 설명되어 있습니다.
using UnityEngine.Purchasing.Extension;public class MyStore : IStore{ private IStoreCallback callback; public void Initialize (IStoreCallback callback) { this.callback = callback; } public void RetrieveProducts (System.Collections.ObjectModel.ReadOnlyCollection<UnityEngine.Purchasing.ProductDefinition> products) { // Fetch product information and invoke callback.OnProductsRetrieved(); } public void Purchase (UnityEngine.Purchasing.ProductDefinition product, string developerPayload) { // Start the purchase flow and call either callback.OnPurchaseSucceeded() or callback.OnPurchaseFailed() } public void FinishTransaction (UnityEngine.Purchasing.ProductDefinition product, string transactionId) { // Perform transaction related housekeeping }}