using System;
using UnityEngine;

public class AdsSDKManager : MonoBehaviour
{
    public static AdsSDKManager instance;
    
    /// <summary>
    /// 看完广告的回调
    /// </summary>
    private Action<double> AdRewardCallback;

    /// <summary>
    /// 广告竞价开关：激励、插屏、全屏Native广告竞价
    /// </summary>
    public bool IsMoreAdsBidding = false;

    private void Awake()
    {
        instance = this;

        InitSDK();
    }


    private void InitSDK()
    {
        KwaiAdsManager.Init();
    }


    /// <summary>
    /// 展示激励广告
    /// </summary>
    /// <param name="callback"></param>
    private void ShowRewardAd(Action<double> callback)
    {
        AdRewardCallback = callback;
    }

    /// <summary>
    /// 广告看完回调
    /// </summary>
    public void OnRewardAdCallback(double price)
    {
        AdRewardCallback?.Invoke(price);
        AdRewardCallback = null;
    }
}
