From 06792d098f9c3b0a1ab8fe0a83a860cab393ad66 Mon Sep 17 00:00:00 2001 From: huyufei Date: Wed, 7 Aug 2024 22:17:53 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E8=A1=A5=E5=85=A8=E5=AF=B9?= =?UTF-8?q?=E5=A4=96=E7=9A=84=E5=90=84=E7=A7=8D=E7=94=A8=E6=88=B7=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runtime/Code/SDK/GuruSDK.Analytics.cs | 78 +++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) 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 游戏打点