修改命名空间&开屏广告
This commit is contained in:
parent
8b7054ef00
commit
b7b1b2c9f4
|
@ -5,10 +5,9 @@ using System.IO;
|
|||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using Google.MiniJSON;
|
||||
using Script.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.Common.FileParse
|
||||
namespace WZ
|
||||
{
|
||||
|
||||
public static class FileParse
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using Script.SDKManager.AdsSDKManager.Constant;
|
||||
|
||||
namespace Script.Common
|
||||
namespace WZ
|
||||
{
|
||||
/// <summary>
|
||||
/// 提供广告SDK功能的统一接口
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
|
||||
namespace Script.Common
|
||||
namespace WZ
|
||||
{
|
||||
[System.Serializable]
|
||||
public class IvRulesData
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
namespace Script.Common
|
||||
namespace WZ
|
||||
{
|
||||
[System.Serializable]
|
||||
public class RevenueData
|
||||
|
|
|
@ -2,7 +2,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.Common
|
||||
namespace WZ
|
||||
{
|
||||
|
||||
public static class StaticValue
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using AdjustSdk;
|
||||
using Script.Utils;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using WZ;
|
||||
|
||||
public class AdjustManager : NormalSingleton<AdjustManager>
|
||||
{
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using System.Collections;
|
||||
using Script.Utils;
|
||||
|
||||
using UnityEngine;
|
||||
using WZ;
|
||||
|
||||
public class AdjustNetwork : NormalSingleton<AdjustNetwork>
|
||||
{
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
using AdjustSdk;
|
||||
using Firebase.RemoteConfig;
|
||||
using Newtonsoft.Json;
|
||||
using Script.Common;
|
||||
using Script.SDKManager.AdsSDKManager.Events.AdsEvents;
|
||||
using Script.Utils;
|
||||
using WZ;
|
||||
|
||||
|
||||
public class AdjustTrackEvent : NormalSingleton<AdjustTrackEvent>
|
||||
{
|
||||
|
|
|
@ -2,15 +2,10 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
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;
|
||||
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
||||
namespace WZ
|
||||
{
|
||||
|
||||
public class AdmobAdsManager : NormalSingleton<AdmobAdsManager>, IAdService
|
||||
|
@ -52,8 +47,6 @@ namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
|||
if (_bannerAdUnits.Count > 0) LoadBanner();
|
||||
if (_interstitialAdUnits.Count > 0) LoadInterstitial();
|
||||
if (_rewardedAdUnits.Count > 0) LoadRewarded();
|
||||
if (_splashAdUnits.Count > 0) LoadSplash();
|
||||
|
||||
_initialized = true;
|
||||
LoggerUtils.Debug("[Admob] init success");
|
||||
});
|
||||
|
@ -271,11 +264,13 @@ namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
|||
private void OnSplashAdDismissed(string adSource, string adUnitId, double revenue)
|
||||
{
|
||||
AdsActionEvents.TrackAdClosed(Platfrom, adSource, adUnitId, AdsType.Splash, "", revenue);
|
||||
AdsSDKManager.Instance.OnSplashAdCloseCallback?.Invoke();
|
||||
}
|
||||
|
||||
private void OnSplashAdError(string adUnitId, int errorCode, string errorMsg)
|
||||
{
|
||||
AdsActionEvents.TrackAdFailToShow(Platfrom, AdsType.Splash, errorMsg, "");
|
||||
AdsSDKManager.Instance.OnSplashAdCloseCallback?.Invoke();
|
||||
}
|
||||
|
||||
private void OnSplashAdClicked(string adSource,string adUnitId,double revenue)
|
||||
|
@ -294,7 +289,6 @@ namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
|||
#region 原生广告功能
|
||||
public void LoadNative()
|
||||
{
|
||||
throw new System.NotImplementedException();
|
||||
}
|
||||
public double GetNativeRevenue()
|
||||
{
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
using System.Collections.Generic;
|
||||
using GoogleMobileAds.Api;
|
||||
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
|
||||
{
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
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
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
||||
namespace WZ
|
||||
{
|
||||
public class AdmobNativeAdManager : MonoBehaviour
|
||||
{
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
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
|
||||
{
|
||||
|
|
|
@ -2,13 +2,9 @@ using System;
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
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;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager
|
||||
namespace WZ
|
||||
{
|
||||
public class AdmobSplashAdManager
|
||||
{
|
||||
|
|
|
@ -2,11 +2,10 @@ using System;
|
|||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using GoogleMobileAds.Api;
|
||||
using Script.Utils;
|
||||
using UnityEngine;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.AdmobAdsManager.Utils
|
||||
namespace WZ
|
||||
{
|
||||
public class AdmobUtils
|
||||
{
|
||||
|
|
|
@ -3,20 +3,15 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using Firebase.RemoteConfig;
|
||||
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;
|
||||
|
||||
namespace WZ
|
||||
{
|
||||
public class AdsSDKManager : NormalSingleton<AdsSDKManager>
|
||||
{
|
||||
private List<IAdService> _adNetworks = new List<IAdService>();
|
||||
// 是否有激励视频或者插屏广告在展示
|
||||
public bool otherAdsOnShow = false;
|
||||
/// <summary>
|
||||
/// 看完广告的回调
|
||||
/// </summary>
|
||||
|
@ -27,8 +22,11 @@ public class AdsSDKManager : NormalSingleton<AdsSDKManager>
|
|||
/// </summary>
|
||||
public bool IsMoreAdsBidding = false;
|
||||
|
||||
public void InitSDK()
|
||||
public Action OnSplashAdCloseCallback;
|
||||
|
||||
public void InitSDK(Action action)
|
||||
{
|
||||
OnSplashAdCloseCallback = action;
|
||||
// 初始化广告平台状态
|
||||
BidPlatformManager.Instance.InitializePlatformStates(AdConfigParser.GetAdExpireInSec());
|
||||
InitializeAdNetworks();
|
||||
|
@ -45,6 +43,7 @@ public class AdsSDKManager : NormalSingleton<AdsSDKManager>
|
|||
{
|
||||
network.Initialize();
|
||||
}
|
||||
AdsSplashManager.Instance.InitSplash();
|
||||
}
|
||||
|
||||
public bool IsRewardAdReady()
|
||||
|
@ -64,7 +63,6 @@ public class AdsSDKManager : NormalSingleton<AdsSDKManager>
|
|||
_showFailedCallback?.Invoke();
|
||||
return;
|
||||
}
|
||||
|
||||
PlatformType result = GetBestPlatformType(false);
|
||||
BidPlatformManager.Instance.RecordBidSuccess(result, AdsType.Rewarded);
|
||||
if (result == PlatformType.AppLovin)
|
||||
|
@ -113,7 +111,7 @@ public class AdsSDKManager : NormalSingleton<AdsSDKManager>
|
|||
_closeCallback = null;
|
||||
return;
|
||||
}
|
||||
|
||||
otherAdsOnShow = true;
|
||||
PlatformType result = GetBestPlatformType(true);
|
||||
BidPlatformManager.Instance.RecordBidSuccess(result, AdsType.Interstitial);
|
||||
if (result == PlatformType.AppLovin)
|
||||
|
@ -146,6 +144,23 @@ public class AdsSDKManager : NormalSingleton<AdsSDKManager>
|
|||
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)
|
||||
{
|
||||
if (isInterstitial)
|
||||
|
@ -378,3 +393,4 @@ public class AdsSDKManager : NormalSingleton<AdsSDKManager>
|
|||
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.Generic;
|
||||
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;
|
||||
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.BigoAdsManager
|
||||
namespace WZ
|
||||
{
|
||||
public class BigoAdsManager : NormalSingleton<BigoAdsManager>, IAdService
|
||||
{
|
||||
|
|
|
@ -2,13 +2,9 @@ using System;
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
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;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.BigoAdsManager
|
||||
namespace WZ
|
||||
{
|
||||
|
||||
public class BigoInterstitialAdManager
|
||||
|
|
|
@ -2,12 +2,9 @@ using System;
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using BigoAds.Scripts.Api;
|
||||
using Script.SDKManager.AdsSDKManager.Constant;
|
||||
using Script.SDKManager.AdsSDKManager.Events.AdsEvents;
|
||||
using Script.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.BigoAdsManager
|
||||
namespace WZ
|
||||
{
|
||||
|
||||
public class BigoRewardedAdManager
|
||||
|
|
|
@ -2,7 +2,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.Constant
|
||||
namespace WZ
|
||||
{
|
||||
public enum AdsType
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.Constant
|
||||
namespace WZ
|
||||
{
|
||||
public enum BannerAliignType
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.Constant
|
||||
namespace WZ
|
||||
{
|
||||
public enum IvType
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.Constant
|
||||
namespace WZ
|
||||
{
|
||||
public enum PlatformType
|
||||
{
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Script.SDKManager.AdsSDKManager.Constant;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.Events.AdsEvents
|
||||
|
||||
namespace WZ
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
||||
AdsSDKManager.Instance.otherAdsOnShow = false;
|
||||
}
|
||||
|
||||
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)
|
||||
|
@ -33,7 +33,7 @@ namespace Script.SDKManager.AdsSDKManager.Events.AdsEvents
|
|||
|
||||
public static void TrackAdFailToShow(PlatformType adPlatform, AdsType adFormat, string reason, string pos)
|
||||
{
|
||||
|
||||
AdsSDKManager.Instance.otherAdsOnShow = false;
|
||||
}
|
||||
|
||||
public static void TrackAdPosition(AdsType adFormat, string pos)
|
||||
|
|
|
@ -2,13 +2,10 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using Firebase.Analytics;
|
||||
using Newtonsoft.Json;
|
||||
using Script.SDKManager.AdsSDKManager.Constant;
|
||||
using Script.SDKManager.AdsSDKManager.Utils;
|
||||
using Script.Utils;
|
||||
using Unity.VisualScripting.Antlr3.Runtime;
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.Events.AdsEvents
|
||||
namespace WZ
|
||||
{
|
||||
public class AdsKeyEvents : NormalSingleton<AdsKeyEvents>
|
||||
{
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace WZ
|
||||
{
|
||||
public class InitResultCallbackImpl : KwaiAds.Scripts.Api.InitResultCallback
|
||||
{
|
||||
public void OnSuccess()
|
||||
|
@ -14,3 +16,4 @@ public class InitResultCallbackImpl : KwaiAds.Scripts.Api.InitResultCallback
|
|||
Debug.LogFormat($"快手广告初始化失败 code is {code}, msg:{msg}");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
using KwaiAds.Scripts.Api.Interstitial;
|
||||
using UnityEngine;
|
||||
|
||||
namespace WZ
|
||||
{
|
||||
public class InterstitialAdListener : IInterstitialAdListener
|
||||
{
|
||||
public void OnAdClick()
|
||||
|
@ -29,3 +30,4 @@ public class InterstitialAdListener : IInterstitialAdListener
|
|||
Debug.LogError($"RewardAdListener#OnAdShowFailed , code:{code}, msg:{msg}");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,6 +2,8 @@
|
|||
using KwaiAds.Scripts.Api.Interstitial;
|
||||
using UnityEngine;
|
||||
|
||||
namespace WZ
|
||||
{
|
||||
public class InterstitialAdLoadListener : IInterstitialAdLoadListener
|
||||
{
|
||||
private const int maxLoadCount = 3;
|
||||
|
@ -34,3 +36,4 @@ public class InterstitialAdLoadListener : IInterstitialAdLoadListener
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,10 +2,10 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using KwaiAds.Scripts.Api.Interstitial;
|
||||
using KwaiAds.Scripts.Api.Reward;
|
||||
using Script.SDKManager.AdsSDKManager.BigoAdsManager;
|
||||
using Script.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace WZ
|
||||
{
|
||||
public class KwaiAdsManager : NormalSingleton<KwaiAdsManager>
|
||||
{
|
||||
//目前都是测试id
|
||||
|
@ -129,3 +129,4 @@ public class KwaiAdsManager : NormalSingleton<KwaiAdsManager>
|
|||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
using KwaiAds.Scripts.Api.Reward;
|
||||
using UnityEngine;
|
||||
|
||||
namespace WZ
|
||||
{
|
||||
public class RewardAdListener : IRewardAdListener
|
||||
{
|
||||
public void OnAdClick()
|
||||
|
@ -35,3 +37,4 @@ public class RewardAdListener : IRewardAdListener
|
|||
KwaiAdsManager.Instance.OnRewardAdCallback();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,6 +2,8 @@
|
|||
using KwaiAds.Scripts.Api.Reward;
|
||||
using UnityEngine;
|
||||
|
||||
namespace WZ
|
||||
{
|
||||
public class RewardAdLoadListener : IRewardAdLoadListener
|
||||
{
|
||||
private const int maxLoadCount = 3;
|
||||
|
@ -33,3 +35,4 @@ public class RewardAdLoadListener : IRewardAdLoadListener
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,14 +4,9 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Net.Security;
|
||||
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;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.MaxAdsManager
|
||||
namespace WZ
|
||||
{
|
||||
public class MaxAdsManager : NormalSingleton<MaxAdsManager>, IAdService
|
||||
{
|
||||
|
|
|
@ -5,15 +5,9 @@ using System.Linq;
|
|||
using System.Threading;
|
||||
using AnyThinkAds.Api;
|
||||
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;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.TpnAdsManager
|
||||
namespace WZ
|
||||
{
|
||||
public class TpnAdsManager : NormalSingleton<TpnAdsManager>, IAdService
|
||||
{
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Script.SDKManager.AdsSDKManager.Constant;
|
||||
using Script.Utils;
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.Utils
|
||||
namespace WZ
|
||||
{
|
||||
public static class AdConfigParser
|
||||
{
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Script.SDKManager.AdsSDKManager.Constant;
|
||||
using Script.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.Utils
|
||||
namespace WZ
|
||||
{
|
||||
public class AdPlayCountManager
|
||||
{
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Script.SDKManager.AdsSDKManager.Constant;
|
||||
using Script.Utils;
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.Utils
|
||||
namespace WZ
|
||||
{
|
||||
public struct AdPriceInfo
|
||||
{
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Script.Utils;
|
||||
using UnityEngine;
|
||||
using Script.SDKManager.AdsSDKManager.Constant;
|
||||
|
||||
namespace Script.SDKManager.AdsSDKManager.Utils
|
||||
namespace WZ
|
||||
{
|
||||
[Serializable]
|
||||
public class AdTypeBidState
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Linq;
|
|||
using System.Threading;
|
||||
using UnityEngine;
|
||||
|
||||
namespace SDKManager.AdsSDKManager.Utils
|
||||
namespace WZ
|
||||
{
|
||||
public class ThreadUtils : MonoBehaviour
|
||||
{
|
||||
|
|
|
@ -4,10 +4,8 @@ using System.Collections.Generic;
|
|||
using EFSDK;
|
||||
using Firebase.RemoteConfig;
|
||||
using Newtonsoft.Json;
|
||||
using Script.Common;
|
||||
using Script.SDKManager.AdsSDKManager.Constant;
|
||||
using Script.Utils;
|
||||
using UnityEngine;
|
||||
using WZ;
|
||||
|
||||
public class AppSDKManager : MonoBehaviour
|
||||
{
|
||||
|
@ -23,10 +21,15 @@ public class AppSDKManager : MonoBehaviour
|
|||
FireBaseSDKManager.Instance.Init();
|
||||
AdjustManager.Instance.Init();
|
||||
ShuShuMangage.Instance.Init();
|
||||
AdsSDKManager.Instance.InitSDK();
|
||||
|
||||
EFSdkManager.Instance.Init();
|
||||
}
|
||||
|
||||
public void Init(Action action)
|
||||
{
|
||||
AdsSDKManager.Instance.InitSDK(action);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 协程
|
||||
/// </summary>
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
using EFSDK;
|
||||
using Firebase.Analytics;
|
||||
using Script.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace WZ
|
||||
{
|
||||
public class EFSdkManager : NormalSingleton<EFSdkManager>
|
||||
{
|
||||
public void Init()
|
||||
|
@ -44,3 +45,4 @@ public class EFSdkManager : NormalSingleton<EFSdkManager>
|
|||
});
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,11 +3,9 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using Firebase.Analytics;
|
||||
using Newtonsoft.Json;
|
||||
using Script.Common;
|
||||
using Script.SDKManager.AdsSDKManager.Constant;
|
||||
using Script.SDKManager.AdsSDKManager.Events.AdsEvents;
|
||||
using Script.Utils;
|
||||
|
||||
namespace WZ
|
||||
{
|
||||
/// <summary>
|
||||
/// Firebase analytics事件上报
|
||||
/// </summary>
|
||||
|
@ -168,3 +166,4 @@ public class FireBaseAnalyticsManager : NormalSingleton<FireBaseAnalyticsManager
|
|||
return name;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,10 +2,10 @@
|
|||
using System.Globalization;
|
||||
using Firebase.Extensions;
|
||||
using Firebase.RemoteConfig;
|
||||
using Script.Utils;
|
||||
using SDK.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace WZ
|
||||
{
|
||||
public class FireBaseRemoteConfigManager : NormalSingleton<FireBaseRemoteConfigManager>
|
||||
{
|
||||
public void FetchRemoteConfig()
|
||||
|
@ -217,3 +217,4 @@ public class FireBaseRemoteConfigManager : NormalSingleton<FireBaseRemoteConfigM
|
|||
return configValue.DoubleValue;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,9 +3,10 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using Firebase;
|
||||
using Firebase.RemoteConfig;
|
||||
using Script.Utils;
|
||||
using UnityEngine;
|
||||
|
||||
namespace WZ
|
||||
{
|
||||
public class FireBaseSDKManager : NormalSingleton<FireBaseSDKManager>
|
||||
{
|
||||
public void Init()
|
||||
|
@ -19,3 +20,4 @@ public class FireBaseSDKManager : NormalSingleton<FireBaseSDKManager>
|
|||
FireBaseAnalyticsManager.Instance.InitSuperProperties();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,8 +1,9 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Script.Utils;
|
||||
using ThinkingData.Analytics;
|
||||
|
||||
namespace WZ
|
||||
{
|
||||
public class ShuShuEvent : NormalSingleton<ShuShuEvent>
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -89,3 +90,4 @@ public class ShuShuEvent : NormalSingleton<ShuShuEvent>
|
|||
TDAnalytics.Track("ad_impression", properties);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Script.Utils;
|
||||
using ThinkingData.Analytics;
|
||||
using UnityEngine;
|
||||
|
||||
namespace WZ
|
||||
{
|
||||
public class ShuShuMangage : NormalSingleton<ShuShuMangage>
|
||||
{
|
||||
private const string appid = "80f6819a81c743cbad667ecf242f3133";
|
||||
|
@ -20,3 +20,4 @@ public class ShuShuMangage : NormalSingleton<ShuShuMangage>
|
|||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using WZ;
|
||||
|
||||
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 UnityEngine;
|
||||
|
||||
namespace SDK.Utils
|
||||
namespace WZ
|
||||
{
|
||||
public static class EncryptionUtils
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.Utils
|
||||
namespace WZ
|
||||
{
|
||||
public static class LoggerUtils
|
||||
{
|
||||
|
|
|
@ -2,7 +2,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.Utils
|
||||
namespace WZ
|
||||
{
|
||||
public class PlayerPrefsUtils
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using UnityEngine;
|
||||
|
||||
namespace Script.Utils
|
||||
namespace WZ
|
||||
{
|
||||
public abstract class NormalSingleton<T> where T : new()
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
|
||||
namespace Script.Utils
|
||||
namespace WZ
|
||||
{
|
||||
public class TimeUtils
|
||||
{
|
||||
|
|
|
@ -3,7 +3,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Script.Utils
|
||||
namespace WZ
|
||||
{
|
||||
public class TimerUtils : MonoBehaviour
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue