You've already forked CC-Framework.Commercialization
feat: add editor ad placement diagnostics
This commit is contained in:
@@ -51,6 +51,8 @@ namespace Runtime.ADAggregator
|
||||
|
||||
private string _userId;
|
||||
|
||||
private object[] _initArgs;
|
||||
|
||||
/// <summary>
|
||||
/// 全局任意视频广告播放结束后事件, bool 表示是否完成奖励
|
||||
/// </summary>
|
||||
@@ -74,12 +76,13 @@ namespace Runtime.ADAggregator
|
||||
_instance.name = "[GameUpdater] <color=green>Init<color>";
|
||||
AD_Dicts = new Dictionary<AD_Type, ADPlayer>();
|
||||
_userId = userId;
|
||||
_adController = controller;
|
||||
_adConfig = adConfig;
|
||||
_initArgs = args;
|
||||
#if UNITY_EDITOR
|
||||
onCallback?.Invoke();
|
||||
#else
|
||||
controller.Init(adConfig , args);
|
||||
_adController = controller;
|
||||
_adConfig = adConfig;
|
||||
PrewarmConfiguredPlayers();
|
||||
onCallback?.Invoke();
|
||||
#endif
|
||||
@@ -148,6 +151,7 @@ namespace Runtime.ADAggregator
|
||||
{
|
||||
|
||||
#if UNITY_EDITOR
|
||||
LogEditorAdPlacement(adType, adScene, "play");
|
||||
if (adType == AD_Type.AwardVideo)
|
||||
{
|
||||
this.OnVideoComplete(true);
|
||||
@@ -207,6 +211,7 @@ namespace Runtime.ADAggregator
|
||||
public void EnterAdScenario(AD_Type adType, string adScene)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
LogEditorAdPlacement(adType, adScene, "enter_scene");
|
||||
return;
|
||||
#endif
|
||||
if (!_isInit || mIsGMModel)
|
||||
@@ -263,6 +268,18 @@ namespace Runtime.ADAggregator
|
||||
return string.IsNullOrWhiteSpace(scenario) ? "__default__" : scenario.Trim();
|
||||
}
|
||||
|
||||
private void LogEditorAdPlacement(AD_Type adType, string adScene, string action)
|
||||
{
|
||||
var normalizedScene = NormalizeScenario(adScene);
|
||||
if (_adController is IAdEditorDiagnostics diagnostics)
|
||||
{
|
||||
diagnostics.LogEditorAdPlacement(_adConfig, adType, normalizedScene, action, _initArgs);
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"[ADManager] Editor ad {action}. type={adType}, scene={normalizedScene}");
|
||||
}
|
||||
|
||||
public void CloseAd(AD_Type adType)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
|
||||
Reference in New Issue
Block a user