File tree 1 file changed +7
-20
lines changed
1 file changed +7
-20
lines changed Original file line number Diff line number Diff line change @@ -76,37 +76,24 @@ void GenerateProductImpl()
76
76
var productImplPath = $ "{ pathDefaultScript } /IapProduct.cs";
77
77
var str = "namespace VirtueSky.Iap\n {" ;
78
78
str += "\n \t public struct IapProduct\n \t {" ;
79
-
79
+ str += " \n " ;
80
80
var iapDataProducts = _iapSettings . IapDataProducts ;
81
81
for ( int i = 0 ; i < _iapSettings . IapDataProducts . Count ; i ++ )
82
82
{
83
83
var itemName = iapDataProducts [ i ] . Id . Split ( '.' ) . Last ( ) ;
84
-
84
+ str += $ "// { itemName . ToUpper ( ) } " ;
85
85
str += $ "\n \t \t public const string ID_{ itemName . ToUpper ( ) } = \" { iapDataProducts [ i ] . Id } \" ;";
86
86
87
87
str +=
88
- $ "\n \t \t public static IapDataProduct Purchase{ CultureInfo . CurrentCulture . TextInfo . ToTitleCase ( itemName ) } ()";
89
- str += "\n \t \t {" ;
90
- str +=
91
- $ "\n \t \t \t return IapManager.PurchaseProduct(IapSettings.Instance.IapDataProducts[{ i } ]);";
92
- str += "\n \t \t }" ;
93
- str += "\n " ;
88
+ $ "\n \t \t public static IapDataProduct Purchase{ CultureInfo . CurrentCulture . TextInfo . ToTitleCase ( itemName ) } () => IapManager.PurchaseProduct(IapSettings.Instance.IapDataProducts[{ i } ]);";
94
89
95
90
str +=
96
- $ "\n \t \t public static bool IsPurchased{ CultureInfo . CurrentCulture . TextInfo . ToTitleCase ( itemName ) } ()";
97
- str += "\n \t \t {" ;
98
- str +=
99
- $ "\n \t \t \t return IapManager.IsPurchasedProduct(IapSettings.Instance.IapDataProducts[{ i } ]);";
100
- str += "\n \t \t }" ;
101
-
102
- str += "\n " ;
91
+ $ "\n \t \t public static bool IsPurchased{ CultureInfo . CurrentCulture . TextInfo . ToTitleCase ( itemName ) } () => IapManager.IsPurchasedProduct(IapSettings.Instance.IapDataProducts[{ i } ]);";
103
92
104
93
str +=
105
- $ "\n \t \t public static UnityEngine.Purchasing.Product GetProduct{ CultureInfo . CurrentCulture . TextInfo . ToTitleCase ( itemName ) } ()";
106
- str += "\n \t \t {" ;
107
- str +=
108
- $ "\n \t \t \t return IapManager.GetProduct(IapSettings.Instance.IapDataProducts[{ i } ]);";
109
- str += "\n \t \t }" ;
94
+ $ "\n \t \t public static UnityEngine.Purchasing.Product GetProduct{ CultureInfo . CurrentCulture . TextInfo . ToTitleCase ( itemName ) } () => IapManager.GetProduct(IapSettings.Instance.IapDataProducts[{ i } ]);";
95
+
96
+ str += $ "\n \t \t public static float PriceConfig{ CultureInfo . CurrentCulture . TextInfo . ToTitleCase ( itemName ) } () => IapSettings.Instance.IapDataProducts[{ i } ].price;";
110
97
str += "\n " ;
111
98
}
112
99
You can’t perform that action at this time.
0 commit comments