File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,13 +57,21 @@ void GenerateProduct()
5757 _iapSetting . Products . Clear ( ) ;
5858 for ( int i = 0 ; i < _iapSetting . SkusData . Count ; i ++ )
5959 {
60- string itemName = _iapSetting . SkusData [ i ] . Id . Split ( '.' ) . Last ( ) ;
60+ bool isCustomName = false ;
61+ var data = _iapSetting . SkusData [ i ] ;
62+ string itemName = data . Id . Split ( '.' ) . Last ( ) ;
63+ if ( ! string . IsNullOrEmpty ( data . customProductName ) )
64+ {
65+ isCustomName = true ;
66+ itemName = data . customProductName ;
67+ }
68+
6169 var itemDataVariable =
6270 CreateAsset . CreateAndGetScriptableAssetByName < IapDataVariable > ( "/Iap/Products" ,
63- $ "iap_{ itemName . ToLower ( ) } ") ;
64- itemDataVariable . androidId = _iapSetting . SkusData [ i ] . androidId ;
65- itemDataVariable . iosId = _iapSetting . SkusData [ i ] . iosId ;
66- itemDataVariable . productType = _iapSetting . SkusData [ i ] . productType ;
71+ isCustomName ? $ " { itemName . ToLower ( ) } " : $ "iap_{ itemName . ToLower ( ) } ") ;
72+ itemDataVariable . androidId = data . androidId ;
73+ itemDataVariable . iosId = data . iosId ;
74+ itemDataVariable . productType = data . productType ;
6775 _iapSetting . Products . Add ( itemDataVariable ) ;
6876 }
6977
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ public class IapData
3131 {
3232 public string androidId ;
3333 public string iosId ;
34+ public string customProductName ;
3435
3536 public string Id
3637 {
You can’t perform that action at this time.
0 commit comments