update: 更新 IAP 打点参数, 更新参数名称
parent
7883d1f0e2
commit
20938c5678
|
|
@ -607,14 +607,6 @@ namespace Guru.Editor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
n = so.FindProperty("AnalyticsSetting");
|
|
||||||
if (null != n)
|
|
||||||
{
|
|
||||||
// levelEndSuccessNum
|
|
||||||
p = n.serializedObject.FindProperty("AnalyticsSetting.levelEndSuccessNum");
|
|
||||||
p.intValue = _serviceConfig.LevelEndSuccessNum();
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------- AMAZON -----------------------
|
//---------- AMAZON -----------------------
|
||||||
n = so.FindProperty("AmazonSetting");
|
n = so.FindProperty("AmazonSetting");
|
||||||
if (null != n)
|
if (null != n)
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ namespace Guru
|
||||||
/// 主线关卡类型
|
/// 主线关卡类型
|
||||||
/// 只有传入此类型时才会进行 Blevel 的累加
|
/// 只有传入此类型时才会进行 Blevel 的累加
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string LevelCategoryMain = "main";
|
public const string LevelTypeMain = "main";
|
||||||
|
|
||||||
//----------------- 关卡开始类型 ---------------------
|
//----------------- 关卡开始类型 ---------------------
|
||||||
public const string EventLevelStartModePlay = "play";
|
public const string EventLevelStartModePlay = "play";
|
||||||
|
|
@ -64,13 +64,13 @@ namespace Guru
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="levelId"></param>
|
/// <param name="levelId"></param>
|
||||||
/// <param name="levelName"></param>
|
/// <param name="levelName"></param>
|
||||||
/// <param name="levelCategory"></param>
|
/// <param name="levelType"></param>
|
||||||
/// <param name="levelID"></param>
|
/// <param name="levelID"></param>
|
||||||
/// <param name="startType"></param>
|
/// <param name="startType"></param>
|
||||||
/// <param name="isReplay"></param>
|
/// <param name="isReplay"></param>
|
||||||
/// <param name="extra"></param>
|
/// <param name="extra"></param>
|
||||||
public static void LogLevelStart(int levelId, string startType = EventLevelStartModePlay,
|
public static void LogLevelStart(int levelId, string startType = EventLevelStartModePlay,
|
||||||
string levelCategory = LevelCategoryMain, string levelName = "", string levelID = "",
|
string levelType = LevelTypeMain, string levelName = "", string levelID = "",
|
||||||
bool isReplay = false, Dictionary<string, object> extra = null)
|
bool isReplay = false, Dictionary<string, object> extra = null)
|
||||||
{
|
{
|
||||||
if (!IsInitialSuccess)
|
if (!IsInitialSuccess)
|
||||||
|
|
@ -79,41 +79,41 @@ namespace Guru
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Analytics.LogLevelStart(levelId, levelName, levelCategory, levelID, startType, isReplay, extra);
|
Analytics.LogLevelStart(levelId, levelName, levelType, levelID, startType, isReplay, extra);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 游戏点击 Continue 重开始游戏
|
/// 游戏点击 Continue 重开始游戏
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="levelId"></param>
|
/// <param name="levelId"></param>
|
||||||
/// <param name="levelCategory"></param>
|
/// <param name="levelType"></param>
|
||||||
/// <param name="levelName"></param>
|
/// <param name="levelName"></param>
|
||||||
/// <param name="levelID"></param>
|
/// <param name="levelID"></param>
|
||||||
/// <param name="extra"></param>
|
/// <param name="extra"></param>
|
||||||
public static void LogLevelContinue(int levelId, string levelCategory = LevelCategoryMain,
|
public static void LogLevelContinue(int levelId, string levelType = LevelTypeMain,
|
||||||
string levelName = "", string levelID = "", Dictionary<string, object> extra = null)
|
string levelName = "", string levelID = "", Dictionary<string, object> extra = null)
|
||||||
{
|
{
|
||||||
LogLevelStart(levelId, EventLevelStartModeContinue, levelCategory, levelName, levelID, true, extra:extra);
|
LogLevelStart(levelId, EventLevelStartModeContinue, levelType, levelName, levelID, true, extra:extra);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 游戏点击 Continue 重开始游戏
|
/// 游戏点击 Continue 重开始游戏
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="levelId"></param>
|
/// <param name="levelId"></param>
|
||||||
/// <param name="levelCategory"></param>
|
/// <param name="levelType"></param>
|
||||||
/// <param name="levelName"></param>
|
/// <param name="levelName"></param>
|
||||||
/// <param name="levelID"></param>
|
/// <param name="levelID"></param>
|
||||||
public static void LogLevelReplay(int levelId, string levelCategory = LevelCategoryMain,
|
public static void LogLevelReplay(int levelId, string levelType = LevelTypeMain,
|
||||||
string levelName = "", string levelID = "", Dictionary<string, object> extra = null)
|
string levelName = "", string levelID = "", Dictionary<string, object> extra = null)
|
||||||
{
|
{
|
||||||
LogLevelStart(levelId, EventLevelStartModeReplay,levelCategory, levelName, levelID, true, extra:extra);
|
LogLevelStart(levelId, EventLevelStartModeReplay,levelType, levelName, levelID, true, extra:extra);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 游戏胜利打点
|
/// 游戏胜利打点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void LogLevelEnd(int levelId, string result = EventLevelEndSuccess,
|
public static void LogLevelEnd(int levelId, string result = EventLevelEndSuccess,
|
||||||
string levelCategory = LevelCategoryMain, string levelName = "", string levelID = "",
|
string levelType = LevelTypeMain, string levelName = "", string levelID = "",
|
||||||
int? duration = null, int? step = null, int? score = null, Dictionary<string, object> extra = null )
|
int? duration = null, int? step = null, int? score = null, Dictionary<string, object> extra = null )
|
||||||
{
|
{
|
||||||
if (!IsInitialSuccess)
|
if (!IsInitialSuccess)
|
||||||
|
|
@ -125,7 +125,7 @@ namespace Guru
|
||||||
if (InitConfig.AutoRecordFinishedLevels)
|
if (InitConfig.AutoRecordFinishedLevels)
|
||||||
{
|
{
|
||||||
if(result == EventLevelEndSuccess){
|
if(result == EventLevelEndSuccess){
|
||||||
if(levelCategory == LevelCategoryMain)
|
if(levelType == LevelTypeMain)
|
||||||
{
|
{
|
||||||
if (levelId > Model.SuccessLevelId) Model.SuccessLevelId = levelId; // 自动记录关卡完成次数
|
if (levelId > Model.SuccessLevelId) Model.SuccessLevelId = levelId; // 自动记录关卡完成次数
|
||||||
}
|
}
|
||||||
|
|
@ -137,7 +137,22 @@ namespace Guru
|
||||||
Analytics.BPlay = Model.TotalPlayedCount; // 记录 BPlay
|
Analytics.BPlay = Model.TotalPlayedCount; // 记录 BPlay
|
||||||
}
|
}
|
||||||
|
|
||||||
Analytics.LogLevelEnd(levelId, result, levelName, levelCategory, levelID, duration, step, score, extra);
|
Analytics.LogLevelEnd(levelId, result, levelName, levelType, levelID, duration, step, score, extra);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 关卡首次通关
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="levelType"></param>
|
||||||
|
/// <param name="levelName"></param>
|
||||||
|
/// <param name="level"></param>
|
||||||
|
/// <param name="result"></param>
|
||||||
|
/// <param name="duration"></param>
|
||||||
|
/// <param name="extra"></param>
|
||||||
|
public static void LevelFirstEnd(string levelType, string levelName, int level,
|
||||||
|
string result = EventLevelEndSuccess, int? duration = null, Dictionary<string, object> extra = null)
|
||||||
|
{
|
||||||
|
Analytics.LevelFirstEnd(levelType, levelName, level, result, duration, extra);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -146,30 +161,30 @@ namespace Guru
|
||||||
/// 需要为游戏记录详细的失败原因
|
/// 需要为游戏记录详细的失败原因
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void LogLevelFail(int levelId,
|
public static void LogLevelFail(int levelId,
|
||||||
string levelCategory = LevelCategoryMain, string levelName = "", string levelID = "",
|
string levelType = LevelTypeMain, string levelName = "", string levelID = "",
|
||||||
int? duration = null, int? step = null, int? score = null , Dictionary<string, object> extra = null)
|
int? duration = null, int? step = null, int? score = null , Dictionary<string, object> extra = null)
|
||||||
{
|
{
|
||||||
LogLevelEnd(levelId, EventLevelEndFail, levelCategory, levelName, levelID, duration, step, score, extra);
|
LogLevelEnd(levelId, EventLevelEndFail, levelType, levelName, levelID, duration, step, score, extra);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 因退出关卡导致游戏失败
|
/// 因退出关卡导致游戏失败
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void LogLevelFailExit(int levelId,
|
public static void LogLevelFailExit(int levelId,
|
||||||
string levelCategory = LevelCategoryMain, string levelName = "", string levelID = "",
|
string levelType = LevelTypeMain, string levelName = "", string levelID = "",
|
||||||
int? duration = null, int? step = null, int? score = null, Dictionary<string, object> extra = null)
|
int? duration = null, int? step = null, int? score = null, Dictionary<string, object> extra = null)
|
||||||
{
|
{
|
||||||
LogLevelEnd(levelId, EventLevelEndExit, levelCategory, levelName, levelID, duration, step, score, extra);
|
LogLevelEnd(levelId, EventLevelEndExit, levelType, levelName, levelID, duration, step, score, extra);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 因关卡超时导致游戏失败
|
/// 因关卡超时导致游戏失败
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void LogLevelFailTimeout(int levelId,
|
public static void LogLevelFailTimeout(int levelId,
|
||||||
string levelCategory = LevelCategoryMain, string levelName = "", string levelID = "",
|
string levelType = LevelTypeMain, string levelName = "", string levelID = "",
|
||||||
int? duration = null, int? step = null, int? score = null, Dictionary<string, object> extra = null)
|
int? duration = null, int? step = null, int? score = null, Dictionary<string, object> extra = null)
|
||||||
{
|
{
|
||||||
LogLevelEnd(levelId, EventLevelEndTimeout, levelCategory, levelName, levelID, duration, step, score, extra);
|
LogLevelEnd(levelId, EventLevelEndTimeout, levelType, levelName, levelID, duration, step, score, extra);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -314,6 +329,42 @@ namespace Guru
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region IAP 打点
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当付费页面打开时调用
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="scene">付费页面名称, 默认为 Store</param>
|
||||||
|
/// <param name="productId">列表中首个商品的 ProductId </param>
|
||||||
|
public static void OnIAPPageOpen(string scene = "Store", string productId = "")
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(productId))
|
||||||
|
{
|
||||||
|
if (GuruSettings.Instance != null && (GuruSettings.Instance.Products?.Length ?? 0) > 0)
|
||||||
|
{
|
||||||
|
productId = GuruSettings.Instance.Products[0].ProductId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Analytics.IAPImp(scene, productId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 当付费页面关闭时调用
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="scene"></param>
|
||||||
|
/// <param name="productId"></param>
|
||||||
|
public static void OnIAPPageClose(string scene = "Store", string productId = "")
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(productId))
|
||||||
|
{
|
||||||
|
productId = GuruIAP.Instance.CurrentBuyingProductId;
|
||||||
|
}
|
||||||
|
|
||||||
|
Analytics.IAPClose(scene, productId);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region 经济打点
|
#region 经济打点
|
||||||
|
|
||||||
// ************************************************************************************************
|
// ************************************************************************************************
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue