From 1ecd0770857a39e03d37b117df20f14337d6c9c9 Mon Sep 17 00:00:00 2001 From: huyufei Date: Mon, 29 Apr 2024 00:39:38 +0800 Subject: [PATCH] --story=1019658 --user=yufei.hu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [中台] [Editor] 修复SDK 切换到 iOS 后, 运行项目卡死的问题 --- Runtime/GuruAds/Pubmatic/Runtime/AdChannelPubMatic.cs | 2 +- Runtime/GuruCore/Runtime/Ads/ADService.cs | 5 ++++- Runtime/GuruCore/Runtime/Ads/ADServiceBase.cs | 2 +- Runtime/GuruCore/Runtime/Analytics/Analytics.Custom.cs | 5 +++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Runtime/GuruAds/Pubmatic/Runtime/AdChannelPubMatic.cs b/Runtime/GuruAds/Pubmatic/Runtime/AdChannelPubMatic.cs index 7909b9d..2cce42d 100644 --- a/Runtime/GuruAds/Pubmatic/Runtime/AdChannelPubMatic.cs +++ b/Runtime/GuruAds/Pubmatic/Runtime/AdChannelPubMatic.cs @@ -53,7 +53,7 @@ namespace Guru public void Initialize() { #if UNITY_EDITOR - Debug.Log($"=== PubMatic will not init on Editor ==="); + Debug.Log($"=== PubMatic will not init on Editor ==="); #endif if (!IsEnabled) { diff --git a/Runtime/GuruCore/Runtime/Ads/ADService.cs b/Runtime/GuruCore/Runtime/Ads/ADService.cs index c5c2756..7f44c17 100644 --- a/Runtime/GuruCore/Runtime/Ads/ADService.cs +++ b/Runtime/GuruCore/Runtime/Ads/ADService.cs @@ -78,7 +78,10 @@ namespace Guru channel.Initialize(); _adChannels.Add(channel); // PubMatic - +#if UNITY_EDITOR + Debug.Log($"---- Editor Ads Init Over ----"); + _onSdkInitReady?.Invoke(); +#endif } #endregion diff --git a/Runtime/GuruCore/Runtime/Ads/ADServiceBase.cs b/Runtime/GuruCore/Runtime/Ads/ADServiceBase.cs index 2568eb1..537c116 100644 --- a/Runtime/GuruCore/Runtime/Ads/ADServiceBase.cs +++ b/Runtime/GuruCore/Runtime/Ads/ADServiceBase.cs @@ -24,7 +24,7 @@ namespace Guru private bool _isServiceStarted; - private Action _onSdkInitReady; + protected Action _onSdkInitReady; public static Action OnBannerLoaded; diff --git a/Runtime/GuruCore/Runtime/Analytics/Analytics.Custom.cs b/Runtime/GuruCore/Runtime/Analytics/Analytics.Custom.cs index 121c764..0f56f88 100644 --- a/Runtime/GuruCore/Runtime/Analytics/Analytics.Custom.cs +++ b/Runtime/GuruCore/Runtime/Analytics/Analytics.Custom.cs @@ -106,7 +106,12 @@ namespace Guru { if (_hasGotAdjustId) return; +#if UNITY_EDITOR + string adjustId = "editor_fake_adjust_id"; +#else string adjustId = AdjustService.AdjustId; +#endif + if (!string.IsNullOrEmpty(adjustId)) { IPMConfig.ADJUST_ID = adjustId;