diff --git a/Runtime/ADAggregator/ADManager.cs b/Runtime/ADAggregator/ADManager.cs index 40b410b..0dbae38 100644 --- a/Runtime/ADAggregator/ADManager.cs +++ b/Runtime/ADAggregator/ADManager.cs @@ -48,15 +48,20 @@ namespace Runtime.ADAggregator private AsyncAdPlayer _curAsyncPlayer; + private string _userId; + + public string UserId => _userId; + #pragma warning disable CS0414 private bool _isInit = false; #pragma warning restore CS0414 - public void Init(Action onCallback , ADConfig adConfig , IAdController controller , params object[] args) + public void Init(Action onCallback , string userId, ADConfig adConfig , IAdController controller , params object[] args) { _isInit = true; _instance.name = "[GameUpdater] Init"; AD_Dicts = new Dictionary(); + _userId = userId; #if UNITY_EDITOR onCallback?.Invoke(); #else diff --git a/Runtime/ADAggregator/ADPlayer.cs b/Runtime/ADAggregator/ADPlayer.cs index 171b2a9..1c59cba 100644 --- a/Runtime/ADAggregator/ADPlayer.cs +++ b/Runtime/ADAggregator/ADPlayer.cs @@ -30,7 +30,12 @@ namespace Runtime.ADAggregator } public abstract void ShowAD(Action onClose, Action onVideoComplete); - public abstract bool IsReadly(); + + public virtual bool IsReadly() + { + return this.curState == 2; + } + public abstract void LoadAD(); public virtual void OnInit() @@ -43,5 +48,12 @@ namespace Runtime.ADAggregator public virtual void CloseAD() { } + + public void OnError(object code, string message) + { + this.OnErrorAction?.Invoke(); + this.OnErrorAction = null; + curState = 0; + } } } \ No newline at end of file diff --git a/package.json b/package.json index deb69e1..185791d 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.1", + "version": "1.0.2", "unity": "2021.1", "license": "MIT", "repository": {