diff --git a/Runtime/Code/SDK/GuruSDK.Analytics.cs b/Runtime/Code/SDK/GuruSDK.Analytics.cs index 00f62cb..abc60e9 100644 --- a/Runtime/Code/SDK/GuruSDK.Analytics.cs +++ b/Runtime/Code/SDK/GuruSDK.Analytics.cs @@ -9,6 +9,12 @@ namespace Guru /// public partial class GuruSDK { + /// + /// 主线关卡类型 + /// 只有传入此类型时才会进行 Blevel 的累加 + /// + public const string LevelCategoryMain = "main"; + //----------------- 关卡开始类型 --------------------- public const string EventLevelStartModePlay = "play"; public const string EventLevelStartModeReplay = "replay"; @@ -60,7 +66,7 @@ namespace Guru /// /// public static void LogLevelStart(int level, string startType = EventLevelStartModePlay, - string levelCategory = "main", string levelName = "", string levelID = "", + string levelCategory = LevelCategoryMain, string levelName = "", string levelID = "", bool isReplay = false) { if (!IsInitialSuccess) @@ -79,7 +85,7 @@ namespace Guru /// /// /// - public static void LogLevelContinue(int level, string levelCategory = "main", + public static void LogLevelContinue(int level, string levelCategory = LevelCategoryMain, string levelName = "", string levelID = "") { LogLevelStart(level, EventLevelStartModeContinue, levelCategory, levelName, levelID, true); @@ -92,7 +98,7 @@ namespace Guru /// /// /// - public static void LogLevelReplay(int level, string levelCategory = "main", + public static void LogLevelReplay(int level, string levelCategory = LevelCategoryMain, string levelName = "", string levelID = "") { LogLevelStart(level, EventLevelStartModeReplay,levelCategory, levelName, levelID, true); @@ -102,7 +108,7 @@ namespace Guru /// 游戏胜利打点 /// public static void LogLevelEnd(int level, string result = EventLevelEndSuccess, - string levelCategory = "main", string levelName = "", string levelID = "", + string levelCategory = LevelCategoryMain, string levelName = "", string levelID = "", int? duration = null, int? step = null, int? score = null ) { if (!IsInitialSuccess) @@ -114,8 +120,11 @@ namespace Guru if (InitConfig.AutoRecordFinishedLevels) { - if(result == EventLevelEndSuccess) Model.SuccessLevelCount++; // 自动记录关卡完成次数 - Model.TotalPlayedCount++; // 自动记录关卡总次数 + if(result == EventLevelEndSuccess){ + if(levelCategory == LevelCategoryMain) Model.SuccessLevelCount++; // 自动记录关卡完成次数 + Model.TotalPlayedCount++; // 自动记录关卡总次数 + } + Analytics.BLevel = Model.SuccessLevelCount; // 记录 BLevel Analytics.BPlay = Model.TotalPlayedCount; // 记录 BPlay @@ -132,7 +141,7 @@ namespace Guru /// 需要为游戏记录详细的失败原因 /// public static void LogLevelFail(int level, - string levelCategory = "main",string levelName = "", string levelID = "", + string levelCategory = LevelCategoryMain, string levelName = "", string levelID = "", int? duration = null, int? step = null, int? score = null ) { LogLevelEnd(level, EventLevelEndFail, levelCategory, levelName, levelID, duration, step, score); @@ -142,7 +151,7 @@ namespace Guru /// 因退出关卡导致游戏失败 /// public static void LogLevelFailExit(int level, - string levelCategory = "main", string levelName = "", string levelID = "", + string levelCategory = LevelCategoryMain, string levelName = "", string levelID = "", int? duration = null, int? step = null, int? score = null) { LogLevelEnd(level, EventLevelEndExit, levelCategory, levelName, levelID, duration, step, score); @@ -152,7 +161,7 @@ namespace Guru /// 因关卡超时导致游戏失败 /// public static void LogLevelFailTimeout(int level, - string levelCategory = "main", string levelName = "", string levelID = "", + string levelCategory = LevelCategoryMain, string levelName = "", string levelID = "", int? duration = null, int? step = null, int? score = null) { LogLevelEnd(level, EventLevelEndTimeout, levelCategory, levelName, levelID, duration, step, score);