File tree Expand file tree Collapse file tree 1 file changed +7
-20
lines changed Expand file tree Collapse file tree 1 file changed +7
-20
lines changed Original file line number Diff line number Diff line change @@ -76,37 +76,24 @@ void GenerateProductImpl()
7676 var productImplPath = $ "{ pathDefaultScript } /IapProduct.cs";
7777 var str = "namespace VirtueSky.Iap\n {" ;
7878 str += "\n \t public struct IapProduct\n \t {" ;
79-
79+ str += " \n " ;
8080 var iapDataProducts = _iapSettings . IapDataProducts ;
8181 for ( int i = 0 ; i < _iapSettings . IapDataProducts . Count ; i ++ )
8282 {
8383 var itemName = iapDataProducts [ i ] . Id . Split ( '.' ) . Last ( ) ;
84-
84+ str += $ "// { itemName . ToUpper ( ) } " ;
8585 str += $ "\n \t \t public const string ID_{ itemName . ToUpper ( ) } = \" { iapDataProducts [ i ] . Id } \" ;";
8686
8787 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 } ]);";
9489
9590 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 } ]);";
10392
10493 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;";
11097 str += "\n " ;
11198 }
11299
You can’t perform that action at this time.
0 commit comments