1 Commits
1.0.6 ... 1.0.7

Author SHA1 Message Date
b6370d5bf8 fix: log TapADN editor ad placement 2026-06-17 18:21:53 +08:00
3 changed files with 43 additions and 3 deletions

View File

@@ -1,3 +1,9 @@
# [1.0.7]
### 修复
* 接入 `CC-Framework.Commercialization` 的 Editor 诊断接口Unity Editor 模拟点击广告时也会输出 TapADN 当前解析出的广告位 ID。
# [1.0.6] # [1.0.6]
### 修复 ### 修复

View File

@@ -3,7 +3,7 @@ using Dirichlet.Mediation;
using Runtime.ADAggregator; using Runtime.ADAggregator;
using UnityEngine; using UnityEngine;
public sealed class TapadnAdController : IAdController public sealed class TapadnAdController : IAdController, IAdEditorDiagnostics
{ {
public static TapadnControllerOptions CurrentOptions { get; private set; } public static TapadnControllerOptions CurrentOptions { get; private set; }
public static string LastSdkVersion { get; private set; } public static string LastSdkVersion { get; private set; }
@@ -73,4 +73,38 @@ public sealed class TapadnAdController : IAdController
{ {
_maskAction?.Invoke(isOpen); _maskAction?.Invoke(isOpen);
} }
public void LogEditorAdPlacement(ADConfig adConfig, AD_Type adType, string adScene, string action, object[] args)
{
var options = TapadnControllerOptions.Resolve(adConfig, args);
var normalizedScene = string.IsNullOrWhiteSpace(adScene) ? "__default__" : adScene.Trim();
var slotSource = "default";
var slotId = ResolveEditorSlotId(adConfig, options, adType, normalizedScene, out slotSource);
Debug.Log($"[TapADN] Editor ad {action}. type={adType}, scene={normalizedScene}, slot={DisplayEditorValue(slotId)}, source={slotSource}");
}
private static string ResolveEditorSlotId(ADConfig adConfig, TapadnControllerOptions options, AD_Type adType, string adScene, out string slotSource)
{
slotSource = "default";
switch (adType)
{
case AD_Type.AwardVideo:
var defaultRewardedSlotId = adConfig?.BaseAwardAdKeyValue?.value;
var rewardedSlotId = options?.ResolveRewardedSlotId(defaultRewardedSlotId, adScene, out var mapped) ?? defaultRewardedSlotId;
slotSource = mapped ? "scene" : "default";
return rewardedSlotId;
case AD_Type.Interaction:
return adConfig?.BaseInteractionAdKeyValue?.value;
case AD_Type.Splash:
return adConfig?.BaseSplashAdKeyValue?.value;
default:
slotSource = "unsupported";
return null;
}
}
private static string DisplayEditorValue(string value)
{
return string.IsNullOrWhiteSpace(value) ? "<empty>" : value.Trim();
}
} }

View File

@@ -2,7 +2,7 @@
"name": "com.commercialization.tapadn", "name": "com.commercialization.tapadn",
"displayName": "Commercialization.tapadn", "displayName": "Commercialization.tapadn",
"description": "TapADN / Dirichlet mediation implementation for CC-Framework.Commercialization.", "description": "TapADN / Dirichlet mediation implementation for CC-Framework.Commercialization.",
"version": "1.0.6", "version": "1.0.7",
"unity": "2022.3", "unity": "2022.3",
"license": "MIT", "license": "MIT",
"repository": { "repository": {
@@ -15,7 +15,7 @@
"url": "https://gitee.com/foldcc" "url": "https://gitee.com/foldcc"
}, },
"dependencies": { "dependencies": {
"com.foldcc.cc-framework.commercialization": "http://private.lightyears.ltd:18650/foldcc/CC-Framework.Commercialization.git#1.0.15" "com.foldcc.cc-framework.commercialization": "http://private.lightyears.ltd:18650/foldcc/CC-Framework.Commercialization.git#1.0.16"
}, },
"samples": [ "samples": [
{ {