diff --git a/Runtime/Code/SDK/GuruSDK.Analytics.cs b/Runtime/Code/SDK/GuruSDK.Analytics.cs index 4cf7f36..8c08eea 100644 --- a/Runtime/Code/SDK/GuruSDK.Analytics.cs +++ b/Runtime/Code/SDK/GuruSDK.Analytics.cs @@ -374,7 +374,7 @@ namespace Guru //---- Currency ----- if (value > 0) { - EarnVirtualCurrency(currencyName, value, balance, category, itemName,levelName, scene); + EarnVirtualCurrency(currencyName, value, balance, category, itemName, levelName, scene); } //---- Props -------- if (null != props) @@ -382,7 +382,7 @@ namespace Guru int i = 0; while (i < props.Length) { - EarnVirtualCurrency(props[i], 1, 0, category, itemName,levelName, scene); + EarnVirtualCurrency(props[i], 1, 0, category, itemName, levelName, scene); i++; } } @@ -417,18 +417,19 @@ namespace Guru ///
  • 特殊类型: Coin + Props (道具列表)
  • ///
  • 特殊类型: Props (道具列表)
  • /// - /// 货币名称 + /// IAP 道具名称 + /// IAP 道具商品 ID /// 赚取金额 /// 货币总量(累加后) /// 当前关卡名称 /// 应用场景 /// 获取的道具名称列表 - public static void EarnVirtualCurrencyByIAP(string currencyName, + public static void EarnVirtualCurrencyByIAP(string currencyName, string productId, int value = 0, int balance = 0, string levelName = "", string scene = "store", string[] props = null) { string category = Consts.CurrencyCategoryIAP; - string itemName = "sku"; + string itemName = productId; EarnVirtualCurrencyAndProps(currencyName, value, balance, category, itemName, levelName, scene, props); } @@ -518,18 +519,17 @@ namespace Guru /// 通过道具交换/合成或得了其他道具 /// /// - /// + /// /// /// /// /// - public static void EarnPropsByExchange(string propName, string otherPropName, + public static void EarnPropByProp(string propName, string otherName, string scene = Consts.ParameterDefaultScene, int value = 1, int balance = 0, string levelName = "") { string category = Consts.CurrencyCategoryIGB; - string itemName = otherPropName; - EarnVirtualCurrency(propName, value, balance, category, itemName, levelName, scene); + EarnVirtualCurrency(propName, value, balance, category, otherName, levelName, scene); } @@ -608,15 +608,13 @@ namespace Guru int value, int balance, string levelName = "", string scene = "") { - string itemName = ""; string category = Consts.CurrencyCategoryProp; if (props != null && props.Length > 0) { int i = 0; while (i < props.Length) { - itemName = props[i]; - SpendVirtualCurrency(currencyName, value, balance, category, itemName, levelName, scene); + SpendVirtualCurrency(currencyName, value, balance, category, props[i], levelName, scene); i++; } } @@ -651,19 +649,34 @@ namespace Guru int value, int balance, string levelName = "", string scene = "") { - string itemName = ""; string category = Consts.CurrencyCategoryBundle; if (bundles != null && bundles.Length > 0) { int i = 0; while (i < bundles.Length) { - itemName = bundles[i]; - SpendVirtualCurrency(currencyName, value, balance, category, itemName, levelName, scene); + SpendVirtualCurrency(currencyName, value, balance, category, bundles[i], levelName, scene); i++; } } } + + /// + /// 消耗物品, 交换其他物品 + /// + /// + /// + /// + /// + /// + /// + public static void SpendPropWithProp(string propName, string otherName, + int value, int balance, + string levelName = "", string scene = "", string extraCategory = "") + { + string category = string.IsNullOrEmpty(extraCategory) ? Consts.CurrencyCategoryProp : extraCategory; + SpendVirtualCurrency(propName, value, balance, category, otherName, levelName, scene); + } #endregion