3 Commits

Author SHA1 Message Date
377a279ac3 1.0.11 2023-10-19 15:07:16 +08:00
b53846c98f update core 2023-09-14 14:23:12 +08:00
89f5f66322 update core 2023-09-14 14:21:41 +08:00
4 changed files with 39 additions and 25 deletions

View File

@@ -56,6 +56,11 @@ namespace Runtime.ADAggregator
/// </summary> /// </summary>
public event Action<bool> GLOBAL_ShowAwardVideoComplete; public event Action<bool> GLOBAL_ShowAwardVideoComplete;
/// <summary>
/// 全局任意视频广告玩家点击播放时
/// </summary>
public event Action<string , string> GLOBAL_ShowAwardVideoBefore;
public string UserId => _userId; public string UserId => _userId;
#pragma warning disable CS0414 #pragma warning disable CS0414
@@ -140,11 +145,13 @@ namespace Runtime.ADAggregator
/// <param name="callback"></param> /// <param name="callback"></param>
public void AsyncPlayAD(AD_Type adType, string adScene, Action<bool> callback) public void AsyncPlayAD(AD_Type adType, string adScene, Action<bool> callback)
{ {
#if UNITY_EDITOR #if UNITY_EDITOR
if (adType == AD_Type.AwardVideo) if (adType == AD_Type.AwardVideo)
{ {
this.OnVideoComplete(true); this.OnVideoComplete(true);
} }
callback?.Invoke(true); callback?.Invoke(true);
return; return;
#endif #endif
@@ -153,6 +160,7 @@ namespace Runtime.ADAggregator
callback?.Invoke(true); callback?.Invoke(true);
return; return;
} }
_adController.EventLog("adScene", adScene); _adController.EventLog("adScene", adScene);
try try
{ {
@@ -163,7 +171,9 @@ namespace Runtime.ADAggregator
} }
var player = AD_Dicts[adType]; var player = AD_Dicts[adType];
_curAsyncPlayer = new AsyncAdPlayer(player, callback); if (adType == AD_Type.AwardVideo)
GLOBAL_ShowAwardVideoBefore?.Invoke(player.Key , adScene);
_curAsyncPlayer = new AsyncAdPlayer(player, adScene, callback);
} }
catch (Exception e) catch (Exception e)
{ {

View File

@@ -10,6 +10,7 @@ namespace Runtime.ADAggregator
protected int curState; protected int curState;
public string Key; public string Key;
public string AdScene;
protected ADListener adListener; protected ADListener adListener;
public Action OnErrorAction; public Action OnErrorAction;

View File

@@ -11,12 +11,14 @@ namespace Runtime.ADAggregator
private bool isKill; private bool isKill;
private bool isUpdate; private bool isUpdate;
private AdTimeHandler overHandler; private AdTimeHandler overHandler;
private string _Ad_scene;
private float _outTime; private float _outTime;
public AsyncAdPlayer(ADPlayer player , Action<bool> callback) public AsyncAdPlayer(ADPlayer player , string adScene, Action<bool> callback)
{ {
this._Ad_scene = adScene;
this._outTime = 0; this._outTime = 0;
this._callback = callback; this._callback = callback;
this.isKill = false; this.isKill = false;
@@ -33,6 +35,7 @@ namespace Runtime.ADAggregator
} }
ADManager.Instance.OpenMask(); ADManager.Instance.OpenMask();
_adPlayer.OnErrorAction = OnError; _adPlayer.OnErrorAction = OnError;
_adPlayer.AdScene = this._Ad_scene;
isUpdate = true; isUpdate = true;
ADManager.Instance.AddUpdater(DoUpdate); ADManager.Instance.AddUpdater(DoUpdate);
} }

View File

@@ -2,7 +2,7 @@
"name": "com.foldcc.cc-framework.commercialization", "name": "com.foldcc.cc-framework.commercialization",
"displayName": "CC-Framework.commercialization", "displayName": "CC-Framework.commercialization",
"description": "商业化sdk通用组件包含广告、内购、用户统计、归因统计等", "description": "商业化sdk通用组件包含广告、内购、用户统计、归因统计等",
"version": "1.0.7", "version": "1.0.11",
"unity": "2021.1", "unity": "2021.1",
"license": "MIT", "license": "MIT",
"repository": { "repository": {