-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIapDataProduct.cs
57 lines (50 loc) · 1.24 KB
/
IapDataProduct.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using UnityEngine;
namespace VirtueSky.Iap
{
[Serializable]
public class IapDataProduct
{
#if UNITY_ANDROID
public string androidId;
#elif UNITY_IOS
public string iOSId;
#endif
public IapProductType iapProductType;
[Tooltip("Price config for UI or tracking")]
public float price;
[NonSerialized] public Action purchaseSuccessCallback;
[NonSerialized] public Action purchaseFailedCallback;
public string Id
{
get
{
#if UNITY_ANDROID
return androidId;
#elif UNITY_IOS
return iOSId;
#else
return string.Empty;
#endif
}
}
}
public enum IapProductType
{
/// <summary>
/// Consumables may be purchased more than once.
///
/// Purchase history is not typically retained by store
/// systems once consumed.
/// </summary>
Consumable,
/// <summary>
/// Non consumables cannot be repurchased and are owned indefinitely.
/// </summary>
NonConsumable,
/// <summary>
/// Subscriptions have a finite window of validity.
/// </summary>
Subscription
}
}