创建商店标识符到商店名称的新映射。
下面是针对商店类构建 IDs
的示例:
using UnityEngine;
using UnityEngine.Purchasing;
public class MyStoreConfiguration
{
public static ConfigurationBuilder CreateBuilder()
{
ConfigurationBuilder builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
// Use this approach when products have different identifiers on different stores.
// Here, the store-specific ID is "levelpackfoo" for AppleAppStore and all others,
// except for GooglePlay and WinRT where it is "com.unity3d.purchasing.levelpackfoo".
IDs productIds = new IDs() {
{ "levelpackfoo" },
{ "com.unity3d.purchasing.levelpackfoo", GooglePlay.Name, WinRT.Name }
};
builder.AddProduct("levelpackfoo", ProductType.NonConsumable, productIds);
return builder;
}
}