parent
							
								
									a9a61e0709
								
							
						
					
					
						commit
						0888bc4658
					
				|  | @ -75,7 +75,7 @@ namespace Guru.Editor | |||
| 	        string symbolDefine = buildParam.IsBuildRelease ? GameDefine.MACRO_RELEASE : GameDefine.MACRO_DEBUG; | ||||
| 	        string apkPath = string.Empty; | ||||
| 	        string version = Application.version; | ||||
| 	        string extension = buildParam.IsBuildRelease ? ".aab" : ".apk"; | ||||
| 	        string extension = buildParam.IsBuildAAB ? ".aab" : ".apk"; | ||||
| 	        if (EditorUserBuildSettings.exportAsGoogleAndroidProject) extension = ""; // 输出工程 | ||||
| 		    string outputDir = Path.GetFullPath($"{Application.dataPath }/../BuildOutput/Android"); | ||||
| 	        apkPath = $"{outputDir}/{Application.productName.Replace(" ","_")}_{symbolDefine}_{version}_{buildNumber}{extension}"; | ||||
|  |  | |||
|  | @ -194,7 +194,7 @@ namespace Guru | |||
| 
 | ||||
| 	    private static void SetIDFV() | ||||
| 	    { | ||||
| 		    GuruAnalytics.SetAndroidID(DeviceIDHelper.IDFV); | ||||
| 		    GuruAnalytics.SetIDFV(DeviceIDHelper.IDFV); | ||||
| 	    } | ||||
| 	     | ||||
| #endif | ||||
|  |  | |||
|  | @ -5,6 +5,9 @@ namespace Guru | |||
|     using System.Collections.Generic; | ||||
|     using Facebook.Unity; | ||||
|      | ||||
|     // item_category: reward/iap_buy/igc/props/bonus/behavior/others | ||||
|     // item_name:  | ||||
|      | ||||
|     /// <summary> | ||||
|     /// 经济统计接口 | ||||
|     /// </summary> | ||||
|  | @ -27,9 +30,47 @@ namespace Guru | |||
|         public const string CurrencyNameCopper = "copper"; | ||||
|          | ||||
|         //----------- 货币类型常用名称 ------------------ | ||||
|          | ||||
|         /// <summary> | ||||
|         /// 货币获取的类别 | ||||
|         /// </summary> | ||||
|         public enum CurrencyCategory | ||||
|         { | ||||
|             Reward, | ||||
|             IapBuy, | ||||
|             Igc, | ||||
|             Props, | ||||
|             Bonus, | ||||
|             Behavior, | ||||
|             Others, | ||||
|         } | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// 枚举转字符串 | ||||
|         /// </summary> | ||||
|         /// <param name="category"></param> | ||||
|         /// <returns></returns> | ||||
|         private static string GetCategoryString(CurrencyCategory category) | ||||
|         { | ||||
|             switch (category) | ||||
|             { | ||||
|                 case CurrencyCategory.Reward: | ||||
|                     return "reward"; | ||||
|                 case CurrencyCategory.IapBuy: | ||||
|                     return "iap_buy"; | ||||
|                 case CurrencyCategory.Igc: | ||||
|                     return "igc"; | ||||
|                 case CurrencyCategory.Props: | ||||
|                     return "props"; | ||||
|                 case CurrencyCategory.Bonus: | ||||
|                     return "bonus"; | ||||
|                 case CurrencyCategory.Behavior: | ||||
|                     return "behavior"; | ||||
|             } | ||||
|             return "others"; | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
|          | ||||
|          | ||||
|         /// <summary> | ||||
|         /// 获取虚拟货币 | ||||
|         /// </summary> | ||||
|  | @ -51,7 +92,7 @@ namespace Guru | |||
|             if (isIap) method = "iap_buy";   | ||||
|             var data = new Dictionary<string, dynamic>() | ||||
|             { | ||||
|                 { "virtual_currency_name", currencyName }, | ||||
|                 { ParameterVirtualCurrencyName, currencyName }, | ||||
|                 { ParameterValue, value }, | ||||
|                 { ParameterBalance, balance }, | ||||
|                 { ParameterLevelName, levelName }, | ||||
|  |  | |||
|  | @ -1,10 +1,8 @@ | |||
| 
 | ||||
| using UnityEngine; | ||||
| using UnityEngine.Serialization; | ||||
| 
 | ||||
| namespace Guru | ||||
| { | ||||
|     using System; | ||||
|     using UnityEngine; | ||||
|     using UnityEngine.Purchasing; | ||||
| 
 | ||||
|     /// <summary> | ||||
|  | @ -58,8 +56,7 @@ namespace Guru | |||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|      | ||||
|     /// <summary> | ||||
|     /// 商品信息 | ||||
|     /// </summary> | ||||
|  | @ -75,12 +72,11 @@ namespace Guru | |||
|         public string Name => Setting.ProductName; | ||||
|         public string Id => Product.definition.id; | ||||
|         public double Price => (double?)Product?.metadata?.localizedPrice ?? Setting.Price; | ||||
|         public string CurrencyCode => Product?.metadata?.isoCurrencyCode ?? "USD"; | ||||
|         public string CurrencyCode => Product?.metadata?.isoCurrencyCode ?? "$"; | ||||
|         public string Category => Setting.Category; | ||||
|         public string Type => Setting.Type == ProductType.Subscription ? "subscription" : "product"; | ||||
|         public bool IsFree => Setting.IsFree; | ||||
|         public string LocalizedPriceString => Product?.metadata.localizedPriceString ?? $"{CurrencyCode}{Setting.Price}"; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|      | ||||
| } | ||||
		Loading…
	
		Reference in New Issue