修改命名空间&开屏广告
This commit is contained in:
parent
8b7054ef00
commit
b7b1b2c9f4
|
@ -5,10 +5,9 @@ using System.IO;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Google.MiniJSON;
|
using Google.MiniJSON;
|
||||||
using Script.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.Common.FileParse
|
namespace WZ
|
||||||
{
|
{
|
||||||
|
|
||||||
public static class FileParse
|
public static class FileParse
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
|
|
||||||
namespace Script.Common
|
namespace WZ
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 提供广告SDK功能的统一接口
|
/// 提供广告SDK功能的统一接口
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Script.Common
|
namespace WZ
|
||||||
{
|
{
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public class IvRulesData
|
public class IvRulesData
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
namespace Script.Common
|
namespace WZ
|
||||||
{
|
{
|
||||||
[System.Serializable]
|
[System.Serializable]
|
||||||
public class RevenueData
|
public class RevenueData
|
||||||
|
|
|
@ -2,7 +2,7 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.Common
|
namespace WZ
|
||||||
{
|
{
|
||||||
|
|
||||||
public static class StaticValue
|
public static class StaticValue
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using AdjustSdk;
|
using AdjustSdk;
|
||||||
using Script.Utils;
|
|
||||||
using Unity.VisualScripting;
|
using Unity.VisualScripting;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using WZ;
|
||||||
|
|
||||||
public class AdjustManager : NormalSingleton<AdjustManager>
|
public class AdjustManager : NormalSingleton<AdjustManager>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using Script.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using WZ;
|
||||||
|
|
||||||
public class AdjustNetwork : NormalSingleton<AdjustNetwork>
|
public class AdjustNetwork : NormalSingleton<AdjustNetwork>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
using AdjustSdk;
|
using AdjustSdk;
|
||||||
using Firebase.RemoteConfig;
|
using Firebase.RemoteConfig;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Script.Common;
|
using WZ;
|
||||||
using Script.SDKManager.AdsSDKManager.Events.AdsEvents;
|
|
||||||
using Script.Utils;
|
|
||||||
|
|
||||||
public class AdjustTrackEvent : NormalSingleton<AdjustTrackEvent>
|
public class AdjustTrackEvent : NormalSingleton<AdjustTrackEvent>
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,15 +2,10 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using GoogleMobileAds.Api;
|
using GoogleMobileAds.Api;
|
||||||
using Script.Common;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Events.AdsEvents;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Utils;
|
|
||||||
using Script.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
namespace WZ
|
||||||
{
|
{
|
||||||
|
|
||||||
public class AdmobAdsManager : NormalSingleton<AdmobAdsManager>, IAdService
|
public class AdmobAdsManager : NormalSingleton<AdmobAdsManager>, IAdService
|
||||||
|
@ -52,8 +47,6 @@ namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
||||||
if (_bannerAdUnits.Count > 0) LoadBanner();
|
if (_bannerAdUnits.Count > 0) LoadBanner();
|
||||||
if (_interstitialAdUnits.Count > 0) LoadInterstitial();
|
if (_interstitialAdUnits.Count > 0) LoadInterstitial();
|
||||||
if (_rewardedAdUnits.Count > 0) LoadRewarded();
|
if (_rewardedAdUnits.Count > 0) LoadRewarded();
|
||||||
if (_splashAdUnits.Count > 0) LoadSplash();
|
|
||||||
|
|
||||||
_initialized = true;
|
_initialized = true;
|
||||||
LoggerUtils.Debug("[Admob] init success");
|
LoggerUtils.Debug("[Admob] init success");
|
||||||
});
|
});
|
||||||
|
@ -268,14 +261,16 @@ namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnSplashAdDismissed(string adSource,string adUnitId,double revenue)
|
private void OnSplashAdDismissed(string adSource, string adUnitId, double revenue)
|
||||||
{
|
{
|
||||||
AdsActionEvents.TrackAdClosed(Platfrom, adSource, adUnitId, AdsType.Splash, "", revenue);
|
AdsActionEvents.TrackAdClosed(Platfrom, adSource, adUnitId, AdsType.Splash, "", revenue);
|
||||||
|
AdsSDKManager.Instance.OnSplashAdCloseCallback?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnSplashAdError(string adUnitId, int errorCode, string errorMsg)
|
private void OnSplashAdError(string adUnitId, int errorCode, string errorMsg)
|
||||||
{
|
{
|
||||||
AdsActionEvents.TrackAdFailToShow(Platfrom,AdsType.Splash,errorMsg,"");
|
AdsActionEvents.TrackAdFailToShow(Platfrom, AdsType.Splash, errorMsg, "");
|
||||||
|
AdsSDKManager.Instance.OnSplashAdCloseCallback?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnSplashAdClicked(string adSource,string adUnitId,double revenue)
|
private void OnSplashAdClicked(string adSource,string adUnitId,double revenue)
|
||||||
|
@ -294,7 +289,6 @@ namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
||||||
#region 原生广告功能
|
#region 原生广告功能
|
||||||
public void LoadNative()
|
public void LoadNative()
|
||||||
{
|
{
|
||||||
throw new System.NotImplementedException();
|
|
||||||
}
|
}
|
||||||
public double GetNativeRevenue()
|
public double GetNativeRevenue()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using GoogleMobileAds.Api;
|
using GoogleMobileAds.Api;
|
||||||
using System;
|
using System;
|
||||||
using Script.Utils;
|
|
||||||
using Script.SDKManager.AdsSDKManager.AdmobAdsManager.Utils;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Events.AdsEvents;
|
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class AdmobBannerAdManager
|
public class AdmobBannerAdManager
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,12 +1,8 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using GoogleMobileAds.Api;
|
using GoogleMobileAds.Api;
|
||||||
using Script.SDKManager.AdsSDKManager.AdmobAdsManager.Utils;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Events.AdsEvents;
|
|
||||||
using Script.Utils;
|
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class AdmobInterstitialAdManager
|
public class AdmobInterstitialAdManager
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class AdmobNativeAdManager : MonoBehaviour
|
public class AdmobNativeAdManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,13 +1,9 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using GoogleMobileAds.Api;
|
using GoogleMobileAds.Api;
|
||||||
using Script.SDKManager.AdsSDKManager.AdmobAdsManager.Utils;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Events.AdsEvents;
|
|
||||||
using Script.Utils;
|
|
||||||
|
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class AdmobRewardedAdManager
|
public class AdmobRewardedAdManager
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,13 +2,9 @@ using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using GoogleMobileAds.Api;
|
using GoogleMobileAds.Api;
|
||||||
using Script.SDKManager.AdsSDKManager.AdmobAdsManager.Utils;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Events.AdsEvents;
|
|
||||||
using Script.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class AdmobSplashAdManager
|
public class AdmobSplashAdManager
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,11 +2,10 @@ using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using GoogleMobileAds.Api;
|
using GoogleMobileAds.Api;
|
||||||
using Script.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager.Utils
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class AdmobUtils
|
public class AdmobUtils
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,20 +3,15 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Firebase.RemoteConfig;
|
using Firebase.RemoteConfig;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Script.Common;
|
|
||||||
using Script.SDKManager.AdsSDKManager.AdmobAdsManager;
|
|
||||||
using Script.SDKManager.AdsSDKManager.BigoAdsManager;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Events.AdsEvents;
|
|
||||||
using Script.SDKManager.AdsSDKManager.MaxAdsManager;
|
|
||||||
using Script.SDKManager.AdsSDKManager.TpnAdsManager;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Utils;
|
|
||||||
using Script.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class AdsSDKManager : NormalSingleton<AdsSDKManager>
|
namespace WZ
|
||||||
{
|
{
|
||||||
|
public class AdsSDKManager : NormalSingleton<AdsSDKManager>
|
||||||
|
{
|
||||||
private List<IAdService> _adNetworks = new List<IAdService>();
|
private List<IAdService> _adNetworks = new List<IAdService>();
|
||||||
|
// 是否有激励视频或者插屏广告在展示
|
||||||
|
public bool otherAdsOnShow = false;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 看完广告的回调
|
/// 看完广告的回调
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -27,8 +22,11 @@ public class AdsSDKManager : NormalSingleton<AdsSDKManager>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsMoreAdsBidding = false;
|
public bool IsMoreAdsBidding = false;
|
||||||
|
|
||||||
public void InitSDK()
|
public Action OnSplashAdCloseCallback;
|
||||||
|
|
||||||
|
public void InitSDK(Action action)
|
||||||
{
|
{
|
||||||
|
OnSplashAdCloseCallback = action;
|
||||||
// 初始化广告平台状态
|
// 初始化广告平台状态
|
||||||
BidPlatformManager.Instance.InitializePlatformStates(AdConfigParser.GetAdExpireInSec());
|
BidPlatformManager.Instance.InitializePlatformStates(AdConfigParser.GetAdExpireInSec());
|
||||||
InitializeAdNetworks();
|
InitializeAdNetworks();
|
||||||
|
@ -45,6 +43,7 @@ public class AdsSDKManager : NormalSingleton<AdsSDKManager>
|
||||||
{
|
{
|
||||||
network.Initialize();
|
network.Initialize();
|
||||||
}
|
}
|
||||||
|
AdsSplashManager.Instance.InitSplash();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsRewardAdReady()
|
public bool IsRewardAdReady()
|
||||||
|
@ -64,7 +63,6 @@ public class AdsSDKManager : NormalSingleton<AdsSDKManager>
|
||||||
_showFailedCallback?.Invoke();
|
_showFailedCallback?.Invoke();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PlatformType result = GetBestPlatformType(false);
|
PlatformType result = GetBestPlatformType(false);
|
||||||
BidPlatformManager.Instance.RecordBidSuccess(result, AdsType.Rewarded);
|
BidPlatformManager.Instance.RecordBidSuccess(result, AdsType.Rewarded);
|
||||||
if (result == PlatformType.AppLovin)
|
if (result == PlatformType.AppLovin)
|
||||||
|
@ -113,16 +111,16 @@ public class AdsSDKManager : NormalSingleton<AdsSDKManager>
|
||||||
_closeCallback = null;
|
_closeCallback = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
otherAdsOnShow = true;
|
||||||
PlatformType result = GetBestPlatformType(true);
|
PlatformType result = GetBestPlatformType(true);
|
||||||
BidPlatformManager.Instance.RecordBidSuccess(result, AdsType.Interstitial);
|
BidPlatformManager.Instance.RecordBidSuccess(result, AdsType.Interstitial);
|
||||||
if (result == PlatformType.AppLovin)
|
if (result == PlatformType.AppLovin)
|
||||||
{
|
{
|
||||||
MaxAdsManager.Instance.DisplayInterstitial(_adPos, _IvType,_closeCallback);
|
MaxAdsManager.Instance.DisplayInterstitial(_adPos, _IvType, _closeCallback);
|
||||||
}
|
}
|
||||||
else if (result == PlatformType.Admob)
|
else if (result == PlatformType.Admob)
|
||||||
{
|
{
|
||||||
AdmobAdsManager.Instance.DisplayInterstitial(_adPos, _IvType,_closeCallback);
|
AdmobAdsManager.Instance.DisplayInterstitial(_adPos, _IvType, _closeCallback);
|
||||||
}
|
}
|
||||||
else if (result == PlatformType.Bigo)
|
else if (result == PlatformType.Bigo)
|
||||||
{
|
{
|
||||||
|
@ -146,6 +144,23 @@ public class AdsSDKManager : NormalSingleton<AdsSDKManager>
|
||||||
CheckAndRefreshExpiredBids(AdsType.Interstitial);
|
CheckAndRefreshExpiredBids(AdsType.Interstitial);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region 开屏广告
|
||||||
|
public bool IsSplashAvailable()
|
||||||
|
{
|
||||||
|
return _adNetworks.Any(network => network.IsSplashAvailable());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowSplashAd()
|
||||||
|
{
|
||||||
|
AdmobAdsManager.Instance.DisplaySplash();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LoadSplashAd()
|
||||||
|
{
|
||||||
|
AdmobAdsManager.Instance.LoadSplash();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
private PlatformType GetBestPlatformType(bool isInterstitial)
|
private PlatformType GetBestPlatformType(bool isInterstitial)
|
||||||
{
|
{
|
||||||
if (isInterstitial)
|
if (isInterstitial)
|
||||||
|
@ -288,7 +303,7 @@ public class AdsSDKManager : NormalSingleton<AdsSDKManager>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RefreshKwaiAds (AdsType adType)
|
private void RefreshKwaiAds(AdsType adType)
|
||||||
{
|
{
|
||||||
switch (adType)
|
switch (adType)
|
||||||
{
|
{
|
||||||
|
@ -377,4 +392,5 @@ public class AdsSDKManager : NormalSingleton<AdsSDKManager>
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,203 @@
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Firebase.RemoteConfig;
|
||||||
|
using GoogleMobileAds.Api;
|
||||||
|
using GoogleMobileAds.Common;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace WZ
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public class AdsSplashManager : MonoBehaviour
|
||||||
|
{
|
||||||
|
public static AdsSplashManager Instance { get; private set; }
|
||||||
|
public float backgroundTime = 0;
|
||||||
|
private int timeoutDuration = 5;
|
||||||
|
private bool _coldLaunch = true;
|
||||||
|
|
||||||
|
|
||||||
|
private void Awake()
|
||||||
|
{
|
||||||
|
if (Instance != null && Instance != this)
|
||||||
|
{
|
||||||
|
Destroy(gameObject);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Instance = this;
|
||||||
|
DontDestroyOnLoad(gameObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void InitSplash()
|
||||||
|
{
|
||||||
|
timeoutDuration = GetSplashConfigItem().loadtime;
|
||||||
|
StartCoroutine(LoadSplashAdAdWithTimeout());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnAppStateChanged(AppState state)
|
||||||
|
{
|
||||||
|
if (_coldLaunch)
|
||||||
|
{
|
||||||
|
_coldLaunch = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (state == AppState.Foreground)
|
||||||
|
{
|
||||||
|
LoggerUtils.Debug("[AppOpen] 进入前台");
|
||||||
|
CheckSplashAdlash(false);
|
||||||
|
}
|
||||||
|
else if (state == AppState.Background)
|
||||||
|
{
|
||||||
|
backgroundTime = Time.realtimeSinceStartup;
|
||||||
|
LoggerUtils.Debug("[AppOpen] 进入后台 :" + backgroundTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private IEnumerator LoadSplashAdAdWithTimeout()
|
||||||
|
{
|
||||||
|
// 开始加载广告
|
||||||
|
AdsSDKManager.Instance.LoadSplashAd();
|
||||||
|
// 等待5秒或直到广告加载完成
|
||||||
|
float elapsedTime = 0f;
|
||||||
|
while (elapsedTime < timeoutDuration && !AdsSDKManager.Instance.IsSplashAvailable())
|
||||||
|
{
|
||||||
|
elapsedTime += Time.deltaTime;
|
||||||
|
yield return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
CheckSplashAdlash(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
IEnumerator DelayedAction()
|
||||||
|
{
|
||||||
|
yield return new WaitForSeconds(1f);
|
||||||
|
CheckSplashAdlash(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CheckSplashAdlash(bool isCold)
|
||||||
|
{
|
||||||
|
if (!isCold)
|
||||||
|
{
|
||||||
|
// 热启动
|
||||||
|
// 当前有其他类型广告在展示
|
||||||
|
LoggerUtils.Debug(" [AppOpen] 热启动 是否有广告在展示:" + AdsSDKManager.Instance.otherAdsOnShow);
|
||||||
|
if (AdsSDKManager.Instance.otherAdsOnShow) return;
|
||||||
|
|
||||||
|
// 热启动开关
|
||||||
|
var hotSplashSwitch = GetSplashConfigItem().hot_splash_switch == 1;
|
||||||
|
LoggerUtils.Debug(" [AppOpen] 热启动 开关:" + hotSplashSwitch);
|
||||||
|
if (!hotSplashSwitch)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 后台运行时间
|
||||||
|
float resultTime = Time.realtimeSinceStartup - backgroundTime;
|
||||||
|
float onlineTime = GetSplashConfigItem().hot_timegap;
|
||||||
|
LoggerUtils.Debug(" [AppOpen] 后台运行时间差值:" + resultTime + " 在线参数值:" + onlineTime);
|
||||||
|
if (resultTime < onlineTime)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!AdsSDKManager.Instance.IsSplashAvailable())
|
||||||
|
{
|
||||||
|
LoggerUtils.Debug(" [AppOpen] 热启动 广告是否准备好:");
|
||||||
|
AdsSDKManager.Instance.LoadSplashAd();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 展示热启动开屏
|
||||||
|
AdsSDKManager.Instance.ShowSplashAd();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 冷启动
|
||||||
|
// 首次启动
|
||||||
|
var isNew = PlayerPrefsUtils.GetPlayerPrefsInt("Firstcold_Splash_Switch", 0) == 0;
|
||||||
|
// 首次冷启动开关
|
||||||
|
var isFirstShow = GetSplashConfigItem().firstcold_splash_switch == 1;
|
||||||
|
// 冷启动开关
|
||||||
|
var coldSplashSwitch = GetSplashConfigItem().cold_splash_switch == 1;
|
||||||
|
LoggerUtils.Debug(" [AppOpen] 冷启动 开关:" + coldSplashSwitch + " 首次启动是否展示开屏:" + isFirstShow + " 新用户:" + isNew);
|
||||||
|
// 新用户首次启动
|
||||||
|
if (isNew)
|
||||||
|
{
|
||||||
|
PlayerPrefsUtils.SavePlayerPrefsInt("Firstcold_Splash_Switch", 1);
|
||||||
|
if (!isFirstShow)
|
||||||
|
{
|
||||||
|
// 新用户首次不展示
|
||||||
|
AdsSDKManager.Instance.OnSplashAdCloseCallback?.Invoke();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 新用户首次展示
|
||||||
|
if (AdsSDKManager.Instance.IsSplashAvailable())
|
||||||
|
{
|
||||||
|
AdsSDKManager.Instance.ShowSplashAd();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AdsSDKManager.Instance.OnSplashAdCloseCallback?.Invoke();
|
||||||
|
AdsSDKManager.Instance.LoadSplashAd();
|
||||||
|
LoggerUtils.Debug(" [AppOpen] 冷启动广告未准备好");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 非首次启动
|
||||||
|
if (coldSplashSwitch)
|
||||||
|
{
|
||||||
|
// 展示冷启动
|
||||||
|
if (AdsSDKManager.Instance.IsSplashAvailable())
|
||||||
|
{
|
||||||
|
AdsSDKManager.Instance.ShowSplashAd();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AdsSDKManager.Instance.OnSplashAdCloseCallback?.Invoke();
|
||||||
|
AdsSDKManager.Instance.LoadSplashAd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AdsSDKManager.Instance.OnSplashAdCloseCallback?.Invoke();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
AppStateEventNotifier.AppStateChanged += OnAppStateChanged;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string Splash_AD_RULES = "Splash_AD_RULES";
|
||||||
|
private static string Splash_AD_RULES_DEFAULT_VALUE = "[{\"firstcold_splash_switch\":1,\"cold_splash_switch\":1,\"hot_splash_switch\":1,\"hot_timegap\":30,\"loadtime\":5}]";
|
||||||
|
|
||||||
|
public SplashConfigItem GetSplashConfigItem()
|
||||||
|
{
|
||||||
|
string jsonData = FireBaseRemoteConfigManager.Instance.GetRemoteConfigString(Splash_AD_RULES, Splash_AD_RULES_DEFAULT_VALUE);
|
||||||
|
SplashConfigItem[] configItems = DataUtils.FromJsonArray<SplashConfigItem>(jsonData);
|
||||||
|
if (configItems.Length == 0 || configItems == null)
|
||||||
|
{
|
||||||
|
return new SplashConfigItem() { firstcold_splash_switch = 1, cold_splash_switch = 1, hot_splash_switch = 1, hot_timegap = 30, loadtime = 5 };
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return configItems[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public class SplashConfigItem
|
||||||
|
{
|
||||||
|
public int firstcold_splash_switch;
|
||||||
|
public int cold_splash_switch;
|
||||||
|
public int hot_splash_switch;
|
||||||
|
public int hot_timegap;
|
||||||
|
public int loadtime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ad8d5f86e3dbf4c9986fcd1981e0be68
|
|
@ -2,16 +2,10 @@ using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using BigoAds.Scripts.Api;
|
using BigoAds.Scripts.Api;
|
||||||
using Script.Common;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Events.AdsEvents;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Utils;
|
|
||||||
using Script.Utils;
|
|
||||||
using Unity.VisualScripting;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.BigoAdsManager
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class BigoAdsManager : NormalSingleton<BigoAdsManager>, IAdService
|
public class BigoAdsManager : NormalSingleton<BigoAdsManager>, IAdService
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,13 +2,9 @@ using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using BigoAds.Scripts.Api;
|
using BigoAds.Scripts.Api;
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Events.AdsEvents;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Utils;
|
|
||||||
using Script.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.BigoAdsManager
|
namespace WZ
|
||||||
{
|
{
|
||||||
|
|
||||||
public class BigoInterstitialAdManager
|
public class BigoInterstitialAdManager
|
||||||
|
|
|
@ -2,12 +2,9 @@ using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using BigoAds.Scripts.Api;
|
using BigoAds.Scripts.Api;
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Events.AdsEvents;
|
|
||||||
using Script.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.BigoAdsManager
|
namespace WZ
|
||||||
{
|
{
|
||||||
|
|
||||||
public class BigoRewardedAdManager
|
public class BigoRewardedAdManager
|
||||||
|
|
|
@ -2,7 +2,7 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.Constant
|
namespace WZ
|
||||||
{
|
{
|
||||||
public enum AdsType
|
public enum AdsType
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.Constant
|
namespace WZ
|
||||||
{
|
{
|
||||||
public enum BannerAliignType
|
public enum BannerAliignType
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.Constant
|
namespace WZ
|
||||||
{
|
{
|
||||||
public enum IvType
|
public enum IvType
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.Constant
|
namespace WZ
|
||||||
{
|
{
|
||||||
public enum PlatformType
|
public enum PlatformType
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.Events.AdsEvents
|
|
||||||
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class AdsActionEvents
|
public class AdsActionEvents
|
||||||
{
|
{
|
||||||
|
@ -14,12 +14,12 @@ namespace Script.SDKManager.AdsSDKManager.Events.AdsEvents
|
||||||
|
|
||||||
public static void TrackAdClosed(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat, string posotion, double value)
|
public static void TrackAdClosed(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat, string posotion, double value)
|
||||||
{
|
{
|
||||||
|
AdsSDKManager.Instance.otherAdsOnShow = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void TrackAdStartLoad(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat)
|
public static void TrackAdStartLoad(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat)
|
||||||
{
|
{
|
||||||
|
AdsSDKManager.Instance.otherAdsOnShow = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void TrackAdLoaded(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat, double loadTime)
|
public static void TrackAdLoaded(PlatformType adPlatform, string adSource, string adUnitName, AdsType adFormat, double loadTime)
|
||||||
|
@ -33,7 +33,7 @@ namespace Script.SDKManager.AdsSDKManager.Events.AdsEvents
|
||||||
|
|
||||||
public static void TrackAdFailToShow(PlatformType adPlatform, AdsType adFormat, string reason, string pos)
|
public static void TrackAdFailToShow(PlatformType adPlatform, AdsType adFormat, string reason, string pos)
|
||||||
{
|
{
|
||||||
|
AdsSDKManager.Instance.otherAdsOnShow = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void TrackAdPosition(AdsType adFormat, string pos)
|
public static void TrackAdPosition(AdsType adFormat, string pos)
|
||||||
|
|
|
@ -2,13 +2,10 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Firebase.Analytics;
|
using Firebase.Analytics;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Utils;
|
|
||||||
using Script.Utils;
|
|
||||||
using Unity.VisualScripting.Antlr3.Runtime;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.Events.AdsEvents
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class AdsKeyEvents : NormalSingleton<AdsKeyEvents>
|
public class AdsKeyEvents : NormalSingleton<AdsKeyEvents>
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class InitResultCallbackImpl : KwaiAds.Scripts.Api.InitResultCallback
|
namespace WZ
|
||||||
{
|
{
|
||||||
|
public class InitResultCallbackImpl : KwaiAds.Scripts.Api.InitResultCallback
|
||||||
|
{
|
||||||
public void OnSuccess()
|
public void OnSuccess()
|
||||||
{
|
{
|
||||||
Debug.Log("快手广告初始化成功");
|
Debug.Log("快手广告初始化成功");
|
||||||
|
@ -13,4 +15,5 @@ public class InitResultCallbackImpl : KwaiAds.Scripts.Api.InitResultCallback
|
||||||
{
|
{
|
||||||
Debug.LogFormat($"快手广告初始化失败 code is {code}, msg:{msg}");
|
Debug.LogFormat($"快手广告初始化失败 code is {code}, msg:{msg}");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,8 +1,9 @@
|
||||||
using KwaiAds.Scripts.Api.Interstitial;
|
using KwaiAds.Scripts.Api.Interstitial;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
namespace WZ
|
||||||
public class InterstitialAdListener : IInterstitialAdListener
|
|
||||||
{
|
{
|
||||||
|
public class InterstitialAdListener : IInterstitialAdListener
|
||||||
|
{
|
||||||
public void OnAdClick()
|
public void OnAdClick()
|
||||||
{
|
{
|
||||||
// 插页广告调整转换页 | Interstitial ad agjust conversion page
|
// 插页广告调整转换页 | Interstitial ad agjust conversion page
|
||||||
|
@ -28,4 +29,5 @@ public class InterstitialAdListener : IInterstitialAdListener
|
||||||
{
|
{
|
||||||
Debug.LogError($"RewardAdListener#OnAdShowFailed , code:{code}, msg:{msg}");
|
Debug.LogError($"RewardAdListener#OnAdShowFailed , code:{code}, msg:{msg}");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -2,8 +2,10 @@
|
||||||
using KwaiAds.Scripts.Api.Interstitial;
|
using KwaiAds.Scripts.Api.Interstitial;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class InterstitialAdLoadListener : IInterstitialAdLoadListener
|
namespace WZ
|
||||||
{
|
{
|
||||||
|
public class InterstitialAdLoadListener : IInterstitialAdLoadListener
|
||||||
|
{
|
||||||
private const int maxLoadCount = 3;
|
private const int maxLoadCount = 3;
|
||||||
private int currentLoadCount = 0;
|
private int currentLoadCount = 0;
|
||||||
|
|
||||||
|
@ -33,4 +35,5 @@ public class InterstitialAdLoadListener : IInterstitialAdLoadListener
|
||||||
Debug.Log($"InterstitialAdLoadListener#OnAdLoadSuccess , trackId:{trackId}, price:{price}");
|
Debug.Log($"InterstitialAdLoadListener#OnAdLoadSuccess , trackId:{trackId}, price:{price}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -2,12 +2,12 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using KwaiAds.Scripts.Api.Interstitial;
|
using KwaiAds.Scripts.Api.Interstitial;
|
||||||
using KwaiAds.Scripts.Api.Reward;
|
using KwaiAds.Scripts.Api.Reward;
|
||||||
using Script.SDKManager.AdsSDKManager.BigoAdsManager;
|
|
||||||
using Script.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class KwaiAdsManager : NormalSingleton<KwaiAdsManager>
|
namespace WZ
|
||||||
{
|
{
|
||||||
|
public class KwaiAdsManager : NormalSingleton<KwaiAdsManager>
|
||||||
|
{
|
||||||
//目前都是测试id
|
//目前都是测试id
|
||||||
private const string appId = "899999";
|
private const string appId = "899999";
|
||||||
private const string token = "EaCw0AipSYyvf3E7";
|
private const string token = "EaCw0AipSYyvf3E7";
|
||||||
|
@ -127,5 +127,6 @@ public class KwaiAdsManager : NormalSingleton<KwaiAdsManager>
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,8 +1,10 @@
|
||||||
using KwaiAds.Scripts.Api.Reward;
|
using KwaiAds.Scripts.Api.Reward;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class RewardAdListener : IRewardAdListener
|
namespace WZ
|
||||||
{
|
{
|
||||||
|
public class RewardAdListener : IRewardAdListener
|
||||||
|
{
|
||||||
public void OnAdClick()
|
public void OnAdClick()
|
||||||
{
|
{
|
||||||
// 激励广告调整转换页 | Reward ad adjustment conversion page
|
// 激励广告调整转换页 | Reward ad adjustment conversion page
|
||||||
|
@ -34,4 +36,5 @@ public class RewardAdListener : IRewardAdListener
|
||||||
// 获取到激励 | Reward earned
|
// 获取到激励 | Reward earned
|
||||||
KwaiAdsManager.Instance.OnRewardAdCallback();
|
KwaiAdsManager.Instance.OnRewardAdCallback();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -2,8 +2,10 @@
|
||||||
using KwaiAds.Scripts.Api.Reward;
|
using KwaiAds.Scripts.Api.Reward;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class RewardAdLoadListener : IRewardAdLoadListener
|
namespace WZ
|
||||||
{
|
{
|
||||||
|
public class RewardAdLoadListener : IRewardAdLoadListener
|
||||||
|
{
|
||||||
private const int maxLoadCount = 3;
|
private const int maxLoadCount = 3;
|
||||||
private int currentLoadCount = 0;
|
private int currentLoadCount = 0;
|
||||||
|
|
||||||
|
@ -32,4 +34,5 @@ public class RewardAdLoadListener : IRewardAdLoadListener
|
||||||
Debug.Log($"RewardAdLoadListener#OnAdLoadSuccess , trackId:{trackId}, price:{price}");
|
Debug.Log($"RewardAdLoadListener#OnAdLoadSuccess , trackId:{trackId}, price:{price}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -4,14 +4,9 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Net.Security;
|
using System.Net.Security;
|
||||||
using Firebase.Analytics;
|
using Firebase.Analytics;
|
||||||
using Script.Common;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Events.AdsEvents;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Utils;
|
|
||||||
using Script.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.MaxAdsManager
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class MaxAdsManager : NormalSingleton<MaxAdsManager>, IAdService
|
public class MaxAdsManager : NormalSingleton<MaxAdsManager>, IAdService
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,15 +5,9 @@ using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using AnyThinkAds.Api;
|
using AnyThinkAds.Api;
|
||||||
using AnyThinkAds.ThirdParty.LitJson;
|
using AnyThinkAds.ThirdParty.LitJson;
|
||||||
using Script.Common;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Events.AdsEvents;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Utils;
|
|
||||||
using Script.Utils;
|
|
||||||
using SDKManager.AdsSDKManager.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.TpnAdsManager
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class TpnAdsManager : NormalSingleton<TpnAdsManager>, IAdService
|
public class TpnAdsManager : NormalSingleton<TpnAdsManager>, IAdService
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
using Script.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.Utils
|
namespace WZ
|
||||||
{
|
{
|
||||||
public static class AdConfigParser
|
public static class AdConfigParser
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
using Script.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.Utils
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class AdPlayCountManager
|
public class AdPlayCountManager
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
using Script.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.Utils
|
namespace WZ
|
||||||
{
|
{
|
||||||
public struct AdPriceInfo
|
public struct AdPriceInfo
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Script.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
|
|
||||||
namespace Script.SDKManager.AdsSDKManager.Utils
|
namespace WZ
|
||||||
{
|
{
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class AdTypeBidState
|
public class AdTypeBidState
|
||||||
|
|
|
@ -5,7 +5,7 @@ using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace SDKManager.AdsSDKManager.Utils
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class ThreadUtils : MonoBehaviour
|
public class ThreadUtils : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,10 +4,8 @@ using System.Collections.Generic;
|
||||||
using EFSDK;
|
using EFSDK;
|
||||||
using Firebase.RemoteConfig;
|
using Firebase.RemoteConfig;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Script.Common;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
using Script.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using WZ;
|
||||||
|
|
||||||
public class AppSDKManager : MonoBehaviour
|
public class AppSDKManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
@ -23,10 +21,15 @@ public class AppSDKManager : MonoBehaviour
|
||||||
FireBaseSDKManager.Instance.Init();
|
FireBaseSDKManager.Instance.Init();
|
||||||
AdjustManager.Instance.Init();
|
AdjustManager.Instance.Init();
|
||||||
ShuShuMangage.Instance.Init();
|
ShuShuMangage.Instance.Init();
|
||||||
AdsSDKManager.Instance.InitSDK();
|
|
||||||
EFSdkManager.Instance.Init();
|
EFSdkManager.Instance.Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Init(Action action)
|
||||||
|
{
|
||||||
|
AdsSDKManager.Instance.InitSDK(action);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 协程
|
/// 协程
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
using EFSDK;
|
using EFSDK;
|
||||||
using Firebase.Analytics;
|
using Firebase.Analytics;
|
||||||
using Script.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class EFSdkManager : NormalSingleton<EFSdkManager>
|
namespace WZ
|
||||||
{
|
{
|
||||||
|
public class EFSdkManager : NormalSingleton<EFSdkManager>
|
||||||
|
{
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
EFSdk.get().Init((actionType, str) =>
|
EFSdk.get().Init((actionType, str) =>
|
||||||
|
@ -43,4 +44,5 @@ public class EFSdkManager : NormalSingleton<EFSdkManager>
|
||||||
ShuShuEvent.Instance.Track(eventName, dict);
|
ShuShuEvent.Instance.Track(eventName, dict);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -3,16 +3,14 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Firebase.Analytics;
|
using Firebase.Analytics;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Script.Common;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Constant;
|
|
||||||
using Script.SDKManager.AdsSDKManager.Events.AdsEvents;
|
|
||||||
using Script.Utils;
|
|
||||||
|
|
||||||
/// <summary>
|
namespace WZ
|
||||||
/// Firebase analytics事件上报
|
|
||||||
/// </summary>
|
|
||||||
public class FireBaseAnalyticsManager : NormalSingleton<FireBaseAnalyticsManager>
|
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Firebase analytics事件上报
|
||||||
|
/// </summary>
|
||||||
|
public class FireBaseAnalyticsManager : NormalSingleton<FireBaseAnalyticsManager>
|
||||||
|
{
|
||||||
private const string KEY_SUPER_PROPERTIES = "KEY_SUPER_PROPERTIES";
|
private const string KEY_SUPER_PROPERTIES = "KEY_SUPER_PROPERTIES";
|
||||||
|
|
||||||
private Dictionary<string, object> superProperties = new Dictionary<string, object>();
|
private Dictionary<string, object> superProperties = new Dictionary<string, object>();
|
||||||
|
@ -167,4 +165,5 @@ public class FireBaseAnalyticsManager : NormalSingleton<FireBaseAnalyticsManager
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -2,12 +2,12 @@
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Firebase.Extensions;
|
using Firebase.Extensions;
|
||||||
using Firebase.RemoteConfig;
|
using Firebase.RemoteConfig;
|
||||||
using Script.Utils;
|
|
||||||
using SDK.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class FireBaseRemoteConfigManager : NormalSingleton<FireBaseRemoteConfigManager>
|
namespace WZ
|
||||||
{
|
{
|
||||||
|
public class FireBaseRemoteConfigManager : NormalSingleton<FireBaseRemoteConfigManager>
|
||||||
|
{
|
||||||
public void FetchRemoteConfig()
|
public void FetchRemoteConfig()
|
||||||
{
|
{
|
||||||
Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task =>
|
Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task =>
|
||||||
|
@ -216,4 +216,5 @@ public class FireBaseRemoteConfigManager : NormalSingleton<FireBaseRemoteConfigM
|
||||||
|
|
||||||
return configValue.DoubleValue;
|
return configValue.DoubleValue;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -3,11 +3,12 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Firebase;
|
using Firebase;
|
||||||
using Firebase.RemoteConfig;
|
using Firebase.RemoteConfig;
|
||||||
using Script.Utils;
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
public class FireBaseSDKManager : NormalSingleton<FireBaseSDKManager>
|
namespace WZ
|
||||||
{
|
{
|
||||||
|
public class FireBaseSDKManager : NormalSingleton<FireBaseSDKManager>
|
||||||
|
{
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
InitSDK();
|
InitSDK();
|
||||||
|
@ -18,4 +19,5 @@ public class FireBaseSDKManager : NormalSingleton<FireBaseSDKManager>
|
||||||
FireBaseRemoteConfigManager.Instance.FetchRemoteConfig();
|
FireBaseRemoteConfigManager.Instance.FetchRemoteConfig();
|
||||||
FireBaseAnalyticsManager.Instance.InitSuperProperties();
|
FireBaseAnalyticsManager.Instance.InitSuperProperties();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,10 +1,11 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Script.Utils;
|
|
||||||
using ThinkingData.Analytics;
|
using ThinkingData.Analytics;
|
||||||
|
|
||||||
public class ShuShuEvent : NormalSingleton<ShuShuEvent>
|
namespace WZ
|
||||||
{
|
{
|
||||||
|
public class ShuShuEvent : NormalSingleton<ShuShuEvent>
|
||||||
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设置用户属性
|
/// 设置用户属性
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -88,4 +89,5 @@ public class ShuShuEvent : NormalSingleton<ShuShuEvent>
|
||||||
|
|
||||||
TDAnalytics.Track("ad_impression", properties);
|
TDAnalytics.Track("ad_impression", properties);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -1,11 +1,11 @@
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using Script.Utils;
|
|
||||||
using ThinkingData.Analytics;
|
using ThinkingData.Analytics;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
namespace WZ
|
||||||
public class ShuShuMangage : NormalSingleton<ShuShuMangage>
|
|
||||||
{
|
{
|
||||||
|
public class ShuShuMangage : NormalSingleton<ShuShuMangage>
|
||||||
|
{
|
||||||
private const string appid = "80f6819a81c743cbad667ecf242f3133";
|
private const string appid = "80f6819a81c743cbad667ecf242f3133";
|
||||||
private const string server = "https://global-receiver-ta.thinkingdata.cn";
|
private const string server = "https://global-receiver-ta.thinkingdata.cn";
|
||||||
|
|
||||||
|
@ -19,4 +19,5 @@ public class ShuShuMangage : NormalSingleton<ShuShuMangage>
|
||||||
TDAnalytics.Login("TA");
|
TDAnalytics.Login("TA");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using WZ;
|
||||||
|
|
||||||
public class Test : MonoBehaviour
|
public class Test : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace WZ
|
||||||
|
{
|
||||||
|
public static class DataUtils
|
||||||
|
{
|
||||||
|
[System.Serializable]
|
||||||
|
private class Wrapper<T>
|
||||||
|
{
|
||||||
|
public T[] items;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static T[] FromJsonArray<T>(string json)
|
||||||
|
{
|
||||||
|
string wrappedJson = $"{{\"items\":{json}}}";
|
||||||
|
Wrapper<T> wrapper = JsonUtility.FromJson<Wrapper<T>>(wrappedJson);
|
||||||
|
return wrapper.items;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: be1bd83cd48f44fa59b93f7ee10ec4fc
|
|
@ -5,7 +5,7 @@ using System.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace SDK.Utils
|
namespace WZ
|
||||||
{
|
{
|
||||||
public static class EncryptionUtils
|
public static class EncryptionUtils
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||||
using Unity.VisualScripting;
|
using Unity.VisualScripting;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.Utils
|
namespace WZ
|
||||||
{
|
{
|
||||||
public static class LoggerUtils
|
public static class LoggerUtils
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,7 +2,7 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.Utils
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class PlayerPrefsUtils
|
public class PlayerPrefsUtils
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.Utils
|
namespace WZ
|
||||||
{
|
{
|
||||||
public abstract class NormalSingleton<T> where T : new()
|
public abstract class NormalSingleton<T> where T : new()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Script.Utils
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class TimeUtils
|
public class TimeUtils
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,7 +3,7 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Script.Utils
|
namespace WZ
|
||||||
{
|
{
|
||||||
public class TimerUtils : MonoBehaviour
|
public class TimerUtils : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue