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 ----------------------- | ||||
|             n = so.FindProperty("AmazonSetting"); | ||||
|             if (null != n) | ||||
|  |  | |||
|  | @ -16,7 +16,7 @@ namespace Guru | |||
|         /// 主线关卡类型 | ||||
|         /// 只有传入此类型时才会进行 Blevel 的累加 | ||||
|         /// </summary> | ||||
|         public const string LevelCategoryMain = "main"; | ||||
|         public const string LevelTypeMain = "main"; | ||||
|          | ||||
|         //----------------- 关卡开始类型 --------------------- | ||||
|         public const string EventLevelStartModePlay = "play"; | ||||
|  | @ -64,13 +64,13 @@ namespace Guru | |||
|         /// </summary> | ||||
|         /// <param name="levelId"></param> | ||||
|         /// <param name="levelName"></param> | ||||
|         /// <param name="levelCategory"></param> | ||||
|         /// <param name="levelType"></param> | ||||
|         /// <param name="levelID"></param> | ||||
|         /// <param name="startType"></param> | ||||
|         /// <param name="isReplay"></param> | ||||
|         /// <param name="extra"></param> | ||||
|         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) | ||||
|         { | ||||
|             if (!IsInitialSuccess) | ||||
|  | @ -79,41 +79,41 @@ namespace Guru | |||
|                 return; | ||||
|             } | ||||
| 
 | ||||
|             Analytics.LogLevelStart(levelId, levelName, levelCategory, levelID, startType, isReplay, extra); | ||||
|             Analytics.LogLevelStart(levelId, levelName, levelType, levelID, startType, isReplay, extra); | ||||
|         } | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// 游戏点击 Continue 重开始游戏 | ||||
|         /// </summary> | ||||
|         /// <param name="levelId"></param> | ||||
|         /// <param name="levelCategory"></param> | ||||
|         /// <param name="levelType"></param> | ||||
|         /// <param name="levelName"></param> | ||||
|         /// <param name="levelID"></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) | ||||
|         { | ||||
|             LogLevelStart(levelId, EventLevelStartModeContinue, levelCategory, levelName, levelID,  true, extra:extra); | ||||
|             LogLevelStart(levelId, EventLevelStartModeContinue, levelType, levelName, levelID,  true, extra:extra); | ||||
|         } | ||||
|          | ||||
|         /// <summary> | ||||
|         /// 游戏点击 Continue 重开始游戏 | ||||
|         /// </summary> | ||||
|         /// <param name="levelId"></param> | ||||
|         /// <param name="levelCategory"></param> | ||||
|         /// <param name="levelType"></param> | ||||
|         /// <param name="levelName"></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) | ||||
|         { | ||||
|             LogLevelStart(levelId, EventLevelStartModeReplay,levelCategory, levelName, levelID,  true, extra:extra); | ||||
|             LogLevelStart(levelId, EventLevelStartModeReplay,levelType, levelName, levelID,  true, extra:extra); | ||||
|         } | ||||
|          | ||||
|         /// <summary> | ||||
|         /// 游戏胜利打点 | ||||
|         /// </summary> | ||||
|         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 ) | ||||
|         { | ||||
|             if (!IsInitialSuccess) | ||||
|  | @ -121,11 +121,11 @@ namespace Guru | |||
|                 UnityEngine.Debug.LogError($"{Tag} :: LogLevelEnd {levelId} :: Please call <GuruSDK.Start()> first, before you call <LogLevelEnd>."); | ||||
|                 return; | ||||
|             } | ||||
|              | ||||
| 
 | ||||
|             if (InitConfig.AutoRecordFinishedLevels) | ||||
|             { | ||||
|                 if(result == EventLevelEndSuccess){ | ||||
|                     if(levelCategory == LevelCategoryMain) | ||||
|                     if(levelType == LevelTypeMain) | ||||
|                     { | ||||
|                         if (levelId > Model.SuccessLevelId) Model.SuccessLevelId = levelId; // 自动记录关卡完成次数 | ||||
|                     } | ||||
|  | @ -137,39 +137,54 @@ namespace Guru | |||
|                 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); | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// 游戏失败打点 | ||||
|         /// 需要为游戏记录详细的失败原因 | ||||
|         /// </summary> | ||||
|         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) | ||||
|         { | ||||
|             LogLevelEnd(levelId, EventLevelEndFail, levelCategory, levelName, levelID, duration, step, score, extra); | ||||
|             LogLevelEnd(levelId, EventLevelEndFail, levelType, levelName, levelID, duration, step, score, extra); | ||||
|         } | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// 因退出关卡导致游戏失败 | ||||
|         /// </summary> | ||||
|         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) | ||||
|         { | ||||
|             LogLevelEnd(levelId, EventLevelEndExit, levelCategory, levelName, levelID, duration, step, score, extra); | ||||
|             LogLevelEnd(levelId, EventLevelEndExit, levelType, levelName, levelID, duration, step, score, extra); | ||||
|         } | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// 因关卡超时导致游戏失败 | ||||
|         /// </summary> | ||||
|         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) | ||||
|         { | ||||
|             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 | ||||
| 
 | ||||
|         #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 经济打点 | ||||
|          | ||||
|         // ************************************************************************************************ | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue