update: 更新BeLevel 打点判定

feature/item_system
胡宇飞 2024-01-23 17:15:40 +08:00
parent 0bcda4f915
commit 5b3f2844a6
1 changed files with 18 additions and 9 deletions

View File

@ -9,6 +9,12 @@ namespace Guru
/// </summary>
public partial class GuruSDK
{
/// <summary>
/// 主线关卡类型
/// 只有传入此类型时才会进行 Blevel 的累加
/// </summary>
public const string LevelCategoryMain = "main";
//----------------- 关卡开始类型 ---------------------
public const string EventLevelStartModePlay = "play";
public const string EventLevelStartModeReplay = "replay";
@ -60,7 +66,7 @@ namespace Guru
/// <param name="startType"></param>
/// <param name="isReplay"></param>
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
/// <param name="levelCategory"></param>
/// <param name="levelName"></param>
/// <param name="levelID"></param>
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
/// <param name="levelCategory"></param>
/// <param name="levelName"></param>
/// <param name="levelID"></param>
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
/// 游戏胜利打点
/// </summary>
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
/// 需要为游戏记录详细的失败原因
/// </summary>
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
/// 因退出关卡导致游戏失败
/// </summary>
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
/// 因关卡超时导致游戏失败
/// </summary>
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);