diff --git a/Runtime/Code/SDK/GuruSDK.Analytics.cs b/Runtime/Code/SDK/GuruSDK.Analytics.cs index 2d9e9fe..39f1818 100644 --- a/Runtime/Code/SDK/GuruSDK.Analytics.cs +++ b/Runtime/Code/SDK/GuruSDK.Analytics.cs @@ -804,22 +804,24 @@ namespace Guru /// - /// 通过使用 Currency 购买获得 Prop (earn_virtual_currency) (reward:level) + /// 购买获得 Prop (earn_virtual_currency) (reward:level) /// 记录 Prop 增加的打点, 消费游戏内货币 /// - /// 货币名称 - /// 获取的道具名称列表 + /// 购买的道具名称 + /// 消费货币名称 /// 应用场景 - /// 赚取金额 - /// 货币总量(累加后) + /// 购入数量 + /// 道具总量(累加后) /// 当前关卡名称 - public static void LogEarnPropsByVirtualCurrency(string currencyName, string[] props, - string scene = Consts.ParameterDefaultScene, - int value = 1, int balance = 0, string levelName = "", Dictionary extra = null) + /// + public static void LogEarnVirtualCurrencyByIGC(string currencyName, string spendCurrencyName, int value = 0, int balance = 0, + string levelName = "", string scene = "", Dictionary extra = null) { + if (extra.Count == 0) throw new ArgumentException("Value cannot be an empty collection.", nameof(extra)); string category = Consts.CurrencyCategoryIGC; - string itemName = currencyName; - LogEarnVirtualCurrencyAndProps(currencyName, value, balance, category, itemName, levelName, scene, props, extra); + string itemName = spendCurrencyName; + if (string.IsNullOrEmpty(scene)) scene = Consts.ParameterDefaultScene; + LogEarnVirtualCurrencyAndProps(currencyName, value, balance, category, itemName, levelName, scene, null, extra); // TODO 这里的打点不对 } /// @@ -1296,11 +1298,11 @@ namespace Guru /// public static void SetEventPriority(EventPriority priority, string[] eventNames) { - if (!IsInitialSuccess) - { - UnityEngine.Debug.LogError($"{Tag} :: LogEvent {priority} :: Please call first, before you call ."); - return; - } + // if (!IsInitialSuccess) + // { + // UnityEngine.Debug.LogError($"{Tag} :: LogEvent {priority} :: Please call first, before you call ."); + // return; + // } if (Model.event_priorities == null) Model.event_priorities = new Dictionary(10); @@ -1319,11 +1321,11 @@ namespace Guru public static void SetEventPriority(EventPriority priority, string eventName) { - if (!IsInitialSuccess) - { - UnityEngine.Debug.LogError($"{Tag} :: LogEvent {priority} :: Please call first, before you call ."); - return; - } + // if (!IsInitialSuccess) + // { + // UnityEngine.Debug.LogError($"{Tag} :: LogEvent {priority} :: Please call first, before you call ."); + // return; + // } SetEventPriority(priority, new string[]{eventName}); } diff --git a/Runtime/Code/SDK/GuruSDK.Const.cs b/Runtime/Code/SDK/GuruSDK.Const.cs index eb3c8eb..b82d155 100644 --- a/Runtime/Code/SDK/GuruSDK.Const.cs +++ b/Runtime/Code/SDK/GuruSDK.Const.cs @@ -245,7 +245,7 @@ namespace Guru // 经济相关 public const string ParameterBalance = "balance"; // 用于余额 - public const string ParameterDefaultScene = "ingame"; // 货币消费默认场景 + public const string ParameterDefaultScene = "in_game"; // 货币消费默认场景 public const string ParameterVirtualCurrencyName = "virtual_currency_name"; // 虚拟货币名称