diff --git a/Editor/BuildTool/AppBuilder.cs b/Editor/BuildTool/AppBuilder.cs index 6265058..67d1ac2 100644 --- a/Editor/BuildTool/AppBuilder.cs +++ b/Editor/BuildTool/AppBuilder.cs @@ -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}"; diff --git a/Runtime/GuruCore/Runtime/Analytics/Analytics.Custom.cs b/Runtime/GuruCore/Runtime/Analytics/Analytics.Custom.cs index 317c70a..4f29672 100644 --- a/Runtime/GuruCore/Runtime/Analytics/Analytics.Custom.cs +++ b/Runtime/GuruCore/Runtime/Analytics/Analytics.Custom.cs @@ -194,7 +194,7 @@ namespace Guru private static void SetIDFV() { - GuruAnalytics.SetAndroidID(DeviceIDHelper.IDFV); + GuruAnalytics.SetIDFV(DeviceIDHelper.IDFV); } #endif diff --git a/Runtime/GuruCore/Runtime/Analytics/Analytics.Economic.cs b/Runtime/GuruCore/Runtime/Analytics/Analytics.Economic.cs index 3e18924..a650af8 100644 --- a/Runtime/GuruCore/Runtime/Analytics/Analytics.Economic.cs +++ b/Runtime/GuruCore/Runtime/Analytics/Analytics.Economic.cs @@ -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: + /// /// 经济统计接口 /// @@ -27,9 +30,47 @@ namespace Guru public const string CurrencyNameCopper = "copper"; //----------- 货币类型常用名称 ------------------ + + /// + /// 货币获取的类别 + /// + public enum CurrencyCategory + { + Reward, + IapBuy, + Igc, + Props, + Bonus, + Behavior, + Others, + } + + /// + /// 枚举转字符串 + /// + /// + /// + 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"; + } + - - /// /// 获取虚拟货币 /// @@ -51,7 +92,7 @@ namespace Guru if (isIap) method = "iap_buy"; var data = new Dictionary() { - { "virtual_currency_name", currencyName }, + { ParameterVirtualCurrencyName, currencyName }, { ParameterValue, value }, { ParameterBalance, balance }, { ParameterLevelName, levelName }, diff --git a/Runtime/GuruIAP/Runtime/Code/Settings/ProductInfo.cs b/Runtime/GuruIAP/Runtime/Code/Settings/ProductInfo.cs index 257b5f3..c556be1 100644 --- a/Runtime/GuruIAP/Runtime/Code/Settings/ProductInfo.cs +++ b/Runtime/GuruIAP/Runtime/Code/Settings/ProductInfo.cs @@ -1,10 +1,8 @@ -using UnityEngine; -using UnityEngine.Serialization; - namespace Guru { using System; + using UnityEngine; using UnityEngine.Purchasing; /// @@ -58,8 +56,7 @@ namespace Guru } } } - - + /// /// 商品信息 /// @@ -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}"; } - - + } \ No newline at end of file