From bc6f633a2f3cfc01122d8fd4452f69313ddcb32b Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期六, 28 二月 2026 20:44:47 +0800
Subject: [PATCH] 519 子 硬核渠道对接 / 硬核渠道对接

---
 Main/System/BoneField/AdsManager.cs |   52 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 51 insertions(+), 1 deletions(-)

diff --git a/Main/System/BoneField/AdsManager.cs b/Main/System/BoneField/AdsManager.cs
index 25c3c99..b77e85c 100644
--- a/Main/System/BoneField/AdsManager.cs
+++ b/Main/System/BoneField/AdsManager.cs
@@ -1,11 +1,17 @@
 using System;
 using System.Collections.Generic;
+using UnityEngine;
 public class AdsManager : GameSystemManager<AdsManager>
 {
     //<骞垮憡ID,浠婃棩宸查鍙栧箍鍛婂鍔辨鏁�>
     private Dictionary<int, int> adsInfoDict = new Dictionary<int, int>();
     public event Action<int, int, int> OnAdsInfoListUpdateEvent;//ADID type value
     public Dictionary<int, Redpoint> redPointDict = new Dictionary<int, Redpoint>();
+
+    public int waitAdID = 0;  //鍥炶皟鍚庡彂鏀惧鍔辩敤
+    int loadErrorCD = 10;   //绛夊緟10绉掑悗鎵嶈兘鍐嶈姹�
+    public float lastLoadErrorTime = 0;
+
     public override void Init()
     {
         DTC0102_tagCDBPlayer.beforePlayerDataInitializeEventOnRelogin += OnBeforePlayerDataInitializeEvent;
@@ -45,6 +51,7 @@
 
     public void OnBeforePlayerDataInitializeEvent()
     {
+        waitAdID = 0;
         adsInfoDict.Clear();
     }
 
@@ -66,9 +73,52 @@
         GameNetSystem.Instance.SendInfo(pack);
     }
 
-    //濡傛灉鏈夊箍鍛奡DK鎺ュ叆锛岃鍑芥暟鏀规垚鍥炶皟瑙﹀彂
+    //鍖哄垎涓嶅悓娓犻亾鏄惁鏈夊箍鍛奡DK
     public void PlayAds(int ADID)
     {
+        //鏈夊箍鍛婄殑SDK
+        if (VersionConfig.Get().appId == "ryzj")
+        {
+            //瑙嗛鍔犺浇澶辫触闇�瑕佺瓑10绉掑悗鍐嶈皟鐢�
+            //濂栧姳闇�瑕佽缃爣璇嗗搴斿彂鏀�
+            if (WaitForLoadNewAd())
+            {
+                SysNotifyMgr.Instance.ShowTip("AdLoadFail");
+                return;
+            }
+            waitAdID = ADID;
+            SDKUtils.Instance.PlayAds("b69a2b68bb3d22");
+            return;
+        }
+
+        //娌″箍鍛婄殑SDK 鐩存帴缁欏鍔�
+        GetAdsAward(ADID);
+    }
+
+    public void LoadAds()
+    {
+        if (VersionConfig.Get().appId == "ryzj")
+        {
+            if (WaitForLoadNewAd())
+            {
+                return;
+            }
+            SDKUtils.Instance.LoadAds("b69a2b68bb3d22");
+        }
+    }
+
+    //涓婁竴娆″姞杞藉け璐ワ紝妫�鏌ユ槸鍚﹂渶瑕佺瓑寰�
+    public bool WaitForLoadNewAd()
+    {
+        if (Time.time - lastLoadErrorTime < loadErrorCD)
+        {
+            return true;
+        }
+        return false;
+    }
+
+    public void GetAdsAward(int ADID)
+    {
         switch (ADID)
         {
             case 1:

--
Gitblit v1.8.0