diff --git a/Runtime/ADAggregator/ADManager.cs b/Runtime/ADAggregator/ADManager.cs index eecefa4..425f70e 100644 --- a/Runtime/ADAggregator/ADManager.cs +++ b/Runtime/ADAggregator/ADManager.cs @@ -7,8 +7,8 @@ namespace Runtime.ADAggregator public class ADManager : MonoBehaviour { private static ADManager _instance; - private static bool mIsCreate = false; - private static bool mIsGMModel = false; + private static bool mIsCreate = false; + private static bool mIsGMModel = false; public static ADManager Instance { @@ -22,7 +22,7 @@ namespace Runtime.ADAggregator Destroy(objs[i]); } - _instance = new GameObject().AddComponent(); + _instance = new GameObject().AddComponent(); _instance.name = "[GameUpdater] NoInit"; DontDestroyOnLoad(_instance); _instance.InitTimeSystem(); @@ -54,7 +54,12 @@ namespace Runtime.ADAggregator /// /// 全局任意视频广告播放结束后事件, bool 表示是否完成奖励 /// - public event Action GLOBAL_ShowAwardVideoComplete; + public event Action GLOBAL_ShowAwardVideoComplete; + + /// + /// 全局任意视频广告玩家点击播放时 + /// + public event Action GLOBAL_ShowAwardVideoBefore; public string UserId => _userId; @@ -62,13 +67,13 @@ namespace Runtime.ADAggregator private bool _isInit = false; #pragma warning restore CS0414 - public void Init(Action onCallback, string userId, ADConfig adConfig, IAdController controller, - params object[] args) + public void Init(Action onCallback, string userId, ADConfig adConfig, IAdController controller, + params object[] args) { - _isInit = true; + _isInit = true; _instance.name = "[GameUpdater] Init"; - AD_Dicts = new Dictionary(); - _userId = userId; + AD_Dicts = new Dictionary(); + _userId = userId; #if UNITY_EDITOR onCallback?.Invoke(); #else @@ -140,11 +145,13 @@ namespace Runtime.ADAggregator /// public void AsyncPlayAD(AD_Type adType, string adScene, Action callback) { + #if UNITY_EDITOR if (adType == AD_Type.AwardVideo) { this.OnVideoComplete(true); } + callback?.Invoke(true); return; #endif @@ -153,6 +160,7 @@ namespace Runtime.ADAggregator callback?.Invoke(true); return; } + _adController.EventLog("adScene", adScene); try { @@ -163,7 +171,9 @@ namespace Runtime.ADAggregator } var player = AD_Dicts[adType]; - _curAsyncPlayer = new AsyncAdPlayer(player,adScene , callback); + if (adType == AD_Type.AwardVideo) + GLOBAL_ShowAwardVideoBefore?.Invoke(player.Key , adScene); + _curAsyncPlayer = new AsyncAdPlayer(player, adScene, callback); } catch (Exception e) { @@ -212,13 +222,13 @@ namespace Runtime.ADAggregator #region TimeSystem - private List _updateList; - private const int DefaultLength = 1024; - private List _timeHandlers; + private List _updateList; + private const int DefaultLength = 1024; + private List _timeHandlers; private void InitTimeSystem() { - this._updateList = new List(DefaultLength); + this._updateList = new List(DefaultLength); this._timeHandlers = new List(); } diff --git a/package.json b/package.json index b64b8f9..d0e2e51 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "com.foldcc.cc-framework.commercialization", "displayName": "CC-Framework.commercialization", "description": "商业化sdk通用组件,包含广告、内购、用户统计、归因统计等", - "version": "1.0.9", + "version": "1.0.11", "unity": "2021.1", "license": "MIT", "repository": {