diff --git a/Runtime/Code/SDK/GuruSDK.Analytics.cs b/Runtime/Code/SDK/GuruSDK.Analytics.cs index 3131667..31aac9f 100644 --- a/Runtime/Code/SDK/GuruSDK.Analytics.cs +++ b/Runtime/Code/SDK/GuruSDK.Analytics.cs @@ -48,6 +48,84 @@ namespace Guru Analytics.SetUserProperty(key, value); } + public static void SetUID(string uid) + { + Analytics.SetUid(uid); + } + + public static void SetUserBLevel(int bLevel) + { + if (!InitConfig.AutoRecordFinishedLevels) + { + Model.SetBLevelValue(bLevel); + Analytics.BLevel = bLevel; + } + Analytics.SetBLevel(bLevel); + } + + public static void SetUserBPlay(int bPlay) + { + if (!InitConfig.AutoRecordFinishedLevels) + { + Model.SetBPlayValue(bPlay); + Analytics.BPlay = bPlay; + } + Analytics.SetBLevel(bPlay); + } + + /// + /// 上报用户全部的 Coin (当前值) + /// + /// + public static void SetUserCoin(int coins) + { + SetUserProperty(Consts.PropertyCoin, $"{coins}"); + } + + /// + /// 上报用户免费金币的 数量 (累加值) + /// + /// + public static void SetUserNonIapCoin(int freeCoins) + { + SetUserProperty(Consts.PropertyNonIAPCoin, $"{freeCoins}"); + } + + /// + /// 上报用户付费金币的 数量 (累加值) + /// + /// + public static void SetUserIapCoin(int paidCoins) + { + SetUserProperty(Consts.PropertyIAPCoin, $"{paidCoins}"); + } + + public static void SetUserExp(int exp) + { + SetUserProperty(Consts.PropertyExp, $"{exp}"); + } + + public static void SetUserHp(int hp) + { + SetUserProperty(Consts.PropertyHp, $"{hp}"); + } + + public static void SetUserGrade(int grade) + { + SetUserProperty(Consts.PropertyGrade, $"{grade}"); + } + + public static void SetUserIsIAP(bool isIapUser) + { + Analytics.SetIsIapUser(isIapUser); + } + + public static void SetATTStatus(string status) + { + Analytics.SetAttStatus(status); + } + + #endregion #region 游戏打点