2025-09-01 05:59:06 +00:00
|
|
|
using System;
|
2025-08-31 08:42:48 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
2025-09-01 05:59:06 +00:00
|
|
|
using Script.Common;
|
|
|
|
using Script.SDKManager.AdsSDKManager.Constant;
|
|
|
|
using Script.Utils;
|
2025-08-31 08:42:48 +00:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class AppSDKManager : MonoBehaviour
|
|
|
|
{
|
|
|
|
public static AppSDKManager Instance;
|
|
|
|
|
2025-08-31 14:59:14 +00:00
|
|
|
//包名
|
|
|
|
public const string PackageName = "com.rush.cash.earn.fast.real.money.game";
|
|
|
|
|
2025-08-31 08:42:48 +00:00
|
|
|
private void Awake()
|
|
|
|
{
|
|
|
|
Instance = this;
|
|
|
|
|
|
|
|
FireBaseSDKManager.Instance.Init();
|
|
|
|
AdjustManager.Instance.Init();
|
|
|
|
ShuShuMangage.Instance.Init();
|
|
|
|
AdsSDKManager.Instance.InitSDK();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 协程
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="coroutine"></param>
|
|
|
|
public void Coroutine(IEnumerator coroutine)
|
|
|
|
{
|
|
|
|
StartCoroutine(coroutine);
|
|
|
|
}
|
2025-09-01 05:59:06 +00:00
|
|
|
|
|
|
|
public void ShowInterstitial(string position, IvType ivadType = IvType.IV1, Action<double> callback = null)
|
|
|
|
{
|
|
|
|
//插屏展示逻辑
|
|
|
|
bool ivRulesShow = AdsSDKManager.Instance.IvRulesShow(ivadType);
|
|
|
|
if (ivRulesShow)
|
|
|
|
{
|
|
|
|
//是否有缓存
|
|
|
|
bool isInterstitialReady = AdsSDKManager.Instance.IsInterstitialReady();
|
|
|
|
if (isInterstitialReady)
|
|
|
|
{
|
|
|
|
AdsSDKManager.Instance.ShowInterstitialAd(position, ivadType, () =>
|
|
|
|
{
|
|
|
|
//展示完一个插屏之后调用
|
|
|
|
IvRulesConst.CurrentOverLevel = 0;
|
|
|
|
IvRulesConst.CurrentInterval = TimeUtils.GetLocalTimestamp();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-09-01 06:45:25 +00:00
|
|
|
public bool IsRewardAdReady()
|
|
|
|
{
|
|
|
|
return AdsSDKManager.Instance.IsRewardAdReady();;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void ShowRewardAd(string position, Action<double> callback = null)
|
2025-09-01 05:59:06 +00:00
|
|
|
{
|
|
|
|
bool isRewardAdReady = AdsSDKManager.Instance.IsRewardAdReady();
|
|
|
|
if (isRewardAdReady)
|
|
|
|
{
|
2025-09-01 06:45:25 +00:00
|
|
|
AdsSDKManager.Instance.ShowRewardAd(position, (isReward) =>
|
|
|
|
{
|
|
|
|
if (isReward)
|
|
|
|
{
|
|
|
|
//callback?.Invoke();
|
|
|
|
}
|
|
|
|
});
|
2025-09-01 05:59:06 +00:00
|
|
|
}
|
|
|
|
}
|
2025-08-31 08:42:48 +00:00
|
|
|
}
|