update: 更新经济打点接口参数

dev
胡宇飞 2024-06-27 17:41:05 +08:00
parent 42966759b3
commit bcaed876f7
2 changed files with 23 additions and 21 deletions

View File

@ -804,22 +804,24 @@ namespace Guru
/// <summary> /// <summary>
/// 通过使用 Currency 购买获得 Prop (earn_virtual_currency) (reward:level) /// 购买获得 Prop (earn_virtual_currency) (reward:level)
/// 记录 Prop 增加的打点, 消费游戏内货币 /// 记录 Prop 增加的打点, 消费游戏内货币
/// </summary> /// </summary>
/// <param name="currencyName">货币名称</param> /// <param name="currencyName">购买的道具名称</param>
/// <param name="props">获取的道具名称列表</param> /// <param name="spendCurrencyName">消费货币名称</param>
/// <param name="scene">应用场景</param> /// <param name="scene">应用场景</param>
/// <param name="value">赚取金额</param> /// <param name="value">购入数量</param>
/// <param name="balance">货币总量(累加后)</param> /// <param name="balance">道具总量(累加后)</param>
/// <param name="levelName">当前关卡名称</param> /// <param name="levelName">当前关卡名称</param>
public static void LogEarnPropsByVirtualCurrency(string currencyName, string[] props, /// <param name="extra"></param>
string scene = Consts.ParameterDefaultScene, public static void LogEarnVirtualCurrencyByIGC(string currencyName, string spendCurrencyName, int value = 0, int balance = 0,
int value = 1, int balance = 0, string levelName = "", Dictionary<string, object> extra = null) string levelName = "", string scene = "", Dictionary<string, object> extra = null)
{ {
if (extra.Count == 0) throw new ArgumentException("Value cannot be an empty collection.", nameof(extra));
string category = Consts.CurrencyCategoryIGC; string category = Consts.CurrencyCategoryIGC;
string itemName = currencyName; string itemName = spendCurrencyName;
LogEarnVirtualCurrencyAndProps(currencyName, value, balance, category, itemName, levelName, scene, props, extra); if (string.IsNullOrEmpty(scene)) scene = Consts.ParameterDefaultScene;
LogEarnVirtualCurrencyAndProps(currencyName, value, balance, category, itemName, levelName, scene, null, extra); // TODO 这里的打点不对
} }
/// <summary> /// <summary>
@ -1296,11 +1298,11 @@ namespace Guru
/// <param name="eventNames"></param> /// <param name="eventNames"></param>
public static void SetEventPriority(EventPriority priority, string[] eventNames) public static void SetEventPriority(EventPriority priority, string[] eventNames)
{ {
if (!IsInitialSuccess) // if (!IsInitialSuccess)
{ // {
UnityEngine.Debug.LogError($"{Tag} :: LogEvent {priority} :: Please call <GuruSDK.Start()> first, before you call <LogEvent>."); // UnityEngine.Debug.LogError($"{Tag} :: LogEvent {priority} :: Please call <GuruSDK.Start()> first, before you call <LogEvent>.");
return; // return;
} // }
if (Model.event_priorities == null) Model.event_priorities = new Dictionary<string, int>(10); if (Model.event_priorities == null) Model.event_priorities = new Dictionary<string, int>(10);
@ -1319,11 +1321,11 @@ namespace Guru
public static void SetEventPriority(EventPriority priority, string eventName) public static void SetEventPriority(EventPriority priority, string eventName)
{ {
if (!IsInitialSuccess) // if (!IsInitialSuccess)
{ // {
UnityEngine.Debug.LogError($"{Tag} :: LogEvent {priority} :: Please call <GuruSDK.Start()> first, before you call <LogEvent>."); // UnityEngine.Debug.LogError($"{Tag} :: LogEvent {priority} :: Please call <GuruSDK.Start()> first, before you call <LogEvent>.");
return; // return;
} // }
SetEventPriority(priority, new string[]{eventName}); SetEventPriority(priority, new string[]{eventName});
} }

View File

@ -245,7 +245,7 @@ namespace Guru
// 经济相关 // 经济相关
public const string ParameterBalance = "balance"; // 用于余额 public const string ParameterBalance = "balance"; // 用于余额
public const string ParameterDefaultScene = "ingame"; // 货币消费默认场景 public const string ParameterDefaultScene = "in_game"; // 货币消费默认场景
public const string ParameterVirtualCurrencyName = "virtual_currency_name"; // 虚拟货币名称 public const string ParameterVirtualCurrencyName = "virtual_currency_name"; // 虚拟货币名称