예제 #1
0
 public void Event_Ad_End(string _adTeam, AdPlayType _AdPlayType)
 {
     foreach (Type item in analythicsSdkDic.Keys)
     {
         analythicsSdkDic[item].Event_Ad_End(_adTeam, _AdPlayType);
     }
 }
예제 #2
0
    /// <summary>
    /// 获取下一个广告并播放
    /// </summary>
    /// <param name="_AdPlayType"></param>
    void ShowAdHandler(AdPlayType _AdPlayType)
    {
        IAD nextAd = adSdkList[nextAdSdk].Ad;

        AllSDKManager.GetSDK <AllAnalyticsSdk>().Event_Ad_Start(nextAd.Name, _AdPlayType, false);

        switch (_AdPlayType)
        {
        case AdPlayType.Banner:
            nextAd.ShowBanner();
            break;

        case AdPlayType.Interstitial:
            Debug.Log("ShowAdHandler Interstitial ==test==插页播放成功: timeScale=" + Time.timeScale);
            nextAd.ShowInterstitial();
            break;

        case AdPlayType.RewardedVideo:
            Debug.Log("ShowAdHandler ShowRewardedVideo ==test==插页播放成功: timeScale=" + Time.timeScale);
            nextAd.ShowRewardedVideo();
            break;

        default:
            break;
        }
    }
예제 #3
0
    /// <summary>
    /// 广告播放结束埋点(此方法必须与Event_IAP_Start函数成对使用,否则不会发送到友盟)
    ///  注:失败使用此方法
    /// </summary>
    /// <param name="_failed">失败原因</param>
    public void Event_Ad_End(string _adTeam, AdPlayType _AdPlayType, string _failed = "")
    {
        string adPlayMsg = "";
        string key       = "";

        if (AdDic == null || AdDic.Count <= 0)
        {
            return;
        }

        foreach (string _key in AdDic.Keys)
        {
            key = _key;
        }
        adPlayMsg = AdDic[key];
        if (_failed == "no")
        {
            adPlayMsg = "设备ID:" + deveceId + " | 播放结果:失败 | 失败原因:没有用的商家";
        }
        else
        {
            adPlayMsg += " | 播放结果:失败 | 失败原因:" + _failed;
        }
        AllSDKManager.SDKDebug(Name + adPlayMsg);
        AdDic[key] = adPlayMsg;
        //记录完成发送到友盟后台
        if (AdDic != null && AdDic.Count > 0)
        {
            SetEvent(Ad, AdDic);
        }
    }
예제 #4
0
    /// <summary>
    /// 广告播放结束埋点(此方法必须与Event_Ad_Start函数成对使用,否则不会发送到友盟)
    /// 注:成功使用此方法
    /// </summary>
    public void Event_Ad_End(string _adTeam, AdPlayType _AdPlayType)
    {
        string adPlayMsg = "";
        string key       = "";

        if (AdDic == null || AdDic.Count <= 0)
        {
            return;
        }

        foreach (string _key in AdDic.Keys)
        {
            key = _key;
        }

        adPlayMsg = AdDic[key];

        adPlayMsg += " | 播放结果:成功" + " | 关闭时间:" + System.DateTime.Now;
        AllSDKManager.SDKDebug(Name + adPlayMsg);

        AdDic[key] = adPlayMsg;

        //记录完成发送到友盟后台
        if (AdDic != null && AdDic.Count > 0)
        {
            SetEvent(Ad, AdDic);
        }
    }
예제 #5
0
 public void Event_Ad_Start(string _adTeam, AdPlayType _AdPlayType, bool _clear = true)
 {
     if (_AdPlayType == AdPlayType.Banner)
     {
         _clear = true;
     }
     foreach (Type item in analythicsSdkDic.Keys)
     {
         analythicsSdkDic[item].Event_Ad_Start(_adTeam, _AdPlayType, _clear);
     }
 }
예제 #6
0
    /// <summary>
    /// 广告播放开始埋点(此方法必须与Event_Ad_End函数成对使用,否则不会发送到友盟)
    /// </summary>
    /// <param name="_adTeam">广告商</param>
    /// <param name="_AdPlayType">广告类型</param>
    public void Event_Ad_Start(string _adTeam, AdPlayType _AdPlayType, bool _clear)
    {
        string AdPlayType = _AdPlayType.ToString();

        //记录前清空缓存
        AdDic.Clear();

        //开始记录埋点
        string adPlayMsg = "设备ID:" + deveceId + " | 广告商:" + _adTeam + " | 广告类型:" + _AdPlayType + " | 播放时间:" + System.DateTime.Now;

        AllSDKManager.SDKDebug(Name + "设备ID:" + deveceId + " | 广告商:" + _adTeam + " | 广告类型:" + _AdPlayType + " | 播放时间:" + System.DateTime.Now);
        AdDic[_adTeam] = adPlayMsg;
    }
예제 #7
0
    /// <summary>
    /// 广告播放开始埋点(此方法必须与Event_Ad_End函数成对使用,否则不会发送到友盟)
    /// </summary>
    /// <param name="_adTeam">广告商</param>
    /// <param name="_AdPlayType">广告类型</param>
    public void Event_Ad_Start(string _adTeam, AdPlayType _AdPlayType, bool _clear)
    {
        if (_clear)
        {
            if (_AdPlayType == AdPlayType.Banner)
            {
                if (adBuryData_Banner != null && adBuryData_Banner.adTeam.Count > 0)
                {
                    UpLoad(adBuryData_Banner);
                }
                adBuryData_Banner        = new ADBuryData_Banner();
                adBuryData_Banner.action = AdPlay;
            }
            else
            {
                adBuryData        = new ADBuryData();
                adBuryData.action = AdPlay;
            }
        }
        if (_AdPlayType == AdPlayType.Banner)
        {
            adBuryData_Banner.playTime.Add(System.DateTime.Now + "");
        }
        else
        {
            adBuryData.playTime.Add(System.DateTime.Now + "");
        }
        //是否清空缓存
        //if (_clear)
        //{
        //    if (_AdPlayType == AdPlayType.Banner)
        //        adBuryData_Banner = new ADBuryData_Banner();
        //    else
        //        adBuryData = new ADBuryData();

        //    adBuryData.action = AdPlay;

        //}

        //if (_AdPlayType == AdPlayType.Banner)
        //{
        //    adBuryData_Banner.playTime.Add(System.DateTime.Now + "");
        //}
        //else
        //{
        //    adBuryData.playTime.Add(System.DateTime.Now + "");
        //    adBuryData.adTeam.Add(_adTeam);
        //    adBuryData.adPlayType.Add(_AdPlayType.ToString());
        //}
    }
예제 #8
0
    /// <summary>
    /// 广告播放结束埋点(此方法必须与Event_Ad_Start函数成对使用,否则不会发送到友盟)
    /// 注:成功使用此方法
    /// </summary>
    public void Event_Ad_End(string _adTeam, AdPlayType _AdPlayType)
    {
        if (_AdPlayType == AdPlayType.Banner)
        {
            if (adBuryData_Banner.adTeam.Count > 3)
            {
                adBuryData_Banner.playTime.Add(System.DateTime.Now + "");
            }
            adBuryData_Banner.adTeam.Add(_adTeam);
            adBuryData_Banner.adPlayType.Add(AdPlayType.Banner.ToString());
            adBuryData_Banner.playResult.Add("1");
            adBuryData_Banner.failed.Add("");
            adBuryData_Banner.closeTime = System.DateTime.Now + "";
        }
        else
        {
            if (adBuryData.adTeam.Count > 3)
            {
                adBuryData.playTime.Add(System.DateTime.Now + "");
            }
            adBuryData.adTeam.Add(_adTeam);
            adBuryData.adPlayType.Add(_AdPlayType.ToString());
            adBuryData.playResult.Add("1");
            adBuryData.failed.Add("");
            adBuryData.closeTime = System.DateTime.Now + "";
            UpLoad(adBuryData);
        }

        //if (_AdPlayType == AdPlayType.Banner)
        //{
        //    adBuryData_Banner.adTeam.Add(_adTeam);
        //    adBuryData_Banner.adPlayType.Add(AdPlayType.Banner.ToString());
        //    adBuryData_Banner.playResult.Add("1");
        //    adBuryData_Banner.failed.Add("");
        //    adBuryData_Banner.closeTime = System.DateTime.Now + "";
        //    UpLoad(adBuryData_Banner);

        //}
        //else
        //{
        //    adBuryData.playResult.Add("1");
        //    adBuryData.closeTime = System.DateTime.Now + "";
        //    adBuryData.failed.Add("");
        //    UpLoad(adBuryData);
        //}
    }
예제 #9
0
    /// <summary>
    /// 广告播放情况
    /// </summary>
    /// <param name="_isSuccess">是否播放成功</param>
    /// <param name="_AdPlayType">广告类型(banner/interstitial/rewardedVideo)</param>
    /// <param name="_failed">如果失败,失败原因</param>
    public void IsAdDone(string _adTeam, bool _isSuccess, AdPlayType _AdPlayType, string _failed = "")
    {
        AllSDKManager.SDKDebug(Name + "_isSuccess:" + _isSuccess + "  AdPlayType:" + _AdPlayType + " _failed:" + _failed);
        if (_isSuccess)//如果播放成功了
        {
            AllSDKManager.SDKDebug(Name + "播放成功");
            if (_AdPlayType != AdPlayType.Banner)//不是banner的情况下才可以记录广告观看状态
            {
                AllSDKManager.GetSDK <AllAnalyticsSdk>().IsLookAd = true;
            }
            AllSDKManager.GetSDK <AllAnalyticsSdk>().Event_Ad_End(_adTeam, _AdPlayType);

            nextAdSdk = 0;

            //如果是视频奖励广告并且玩家没有跳过则去拿奖励,如果跳过则按失败处理
            if (_AdPlayType == AdPlayType.RewardedVideo)
            {
                if (_failed == "")
                {
                    GetRewarded();
                }
                else
                {
                    if (isAdRewardedDone != null)
                    {
                        isAdRewardedDone(false);
                    }
                }
                GameResume();
                Debug.Log("==test==视频奖励播放失败: timeScale=" + Time.timeScale);
            }
            else
            if (_AdPlayType == AdPlayType.Interstitial)
            {
                if (_failed == "")
                {
                    InterstitialDone();
                }
                else
                {
                    if (isAdInterstitialDone != null)
                    {
                        isAdInterstitialDone(false);
                    }
                }
                GameResume();
                Debug.Log("==test==插页播放失败: timeScale=" + Time.timeScale);
            }

            return;
        }
        else//当前的广告商的广告播放失败
        {
            AllSDKManager.SDKDebug(Name + " ==失败== " + "_isSuccess:" + _isSuccess + "  AdPlayType:" + _AdPlayType + " _failed:" + _failed);
            AllSDKManager.GetSDK <AllAnalyticsSdk>().Event_Ad_End(_adTeam, _AdPlayType, _failed);
            GameResume();
            Debug.Log("==test==视频奖励播放失败222222: timeScale=" + Time.timeScale);
        }

        nextAdSdk++;                      //移位下一个广告商
        if (nextAdSdk >= adSdkList.Count) //没有可供播放的广告商的失败情况
        {
            AllSDKManager.SDKDebug(Name + "no can used team");
            AllSDKManager.GetSDK <AllAnalyticsSdk>().IsLookAd = false;
            AllSDKManager.GetSDK <AllAnalyticsSdk>().Event_Ad_End(_adTeam, _AdPlayType, "no");
            GameResume();
            nextAdSdk = 0;
            if (_AdPlayType == AdPlayType.RewardedVideo)//奖励视频通知不能获得奖励
            {
                if (isAdRewardedDone != null)
                {
                    GameResume();
                    Debug.Log("==test==视频奖励播放失败: timeScale=" + Time.timeScale);
                    isAdRewardedDone(false);
                }
            }
            else if (_AdPlayType == AdPlayType.Interstitial)//插页视频 失败要恢复游戏时间
            {
                if (isAdInterstitialDone != null)
                {
                    GameResume();
                    Debug.Log("==test==插页播放失败: timeScale=" + Time.timeScale);
                    isAdInterstitialDone(false);
                }
            }
            return;
        }

        ShowAdHandler(_AdPlayType);//如果上面那家广告商的广告没有成功投放 则取下一家的继续尝试播放
    }
예제 #10
0
 public void Event_Ad_Start(string _adTeam, AdPlayType _AdPlayType, bool _clear = true)
 {
 }
예제 #11
0
 public void Event_Ad_End(string _adTeam, AdPlayType _AdPlayType, string _failed = "")
 {
 }
예제 #12
0
 public void Event_Ad_End(string _adTeam, AdPlayType _AdPlayType)
 {
 }
예제 #13
0
 /// <summary>
 /// 广告播放结束埋点(此方法必须与Event_IAP_Start函数成对使用,否则不会发送到友盟)
 ///  注:失败使用此方法
 /// </summary>
 /// <param name="_failed">失败原因</param>
 public void Event_Ad_End(string _adTeam, AdPlayType _AdPlayType, string _failed = "")
 {
     if (_AdPlayType == AdPlayType.Banner)
     {
         //if (_failed == "no")
         //{
         //    UpLoad(adBuryData_Banner);
         //}
         //else
         //{
         if (adBuryData_Banner.adTeam.Count > 3)
         {
             adBuryData_Banner.playTime.Add(System.DateTime.Now + "");
         }
         adBuryData_Banner.adTeam.Add(_adTeam);
         adBuryData_Banner.adPlayType.Add(AdPlayType.Banner.ToString());
         adBuryData_Banner.playResult.Add("0");
         adBuryData_Banner.closeTime = "";
         adBuryData_Banner.failed.Add(_failed);
         //}
     }
     else
     {
         if (_failed == "no")
         {
             UpLoad(adBuryData);
         }
         else
         {
             if (adBuryData.adTeam.Count > 3)
             {
                 adBuryData.playTime.Add(System.DateTime.Now + "");
             }
             adBuryData.adTeam.Add(_adTeam);
             adBuryData.adPlayType.Add(_AdPlayType.ToString());
             adBuryData.playResult.Add("0");
             adBuryData.closeTime = "";
             adBuryData.failed.Add(_failed);
         }
     }
     //if (_AdPlayType == AdPlayType.Banner)
     //{
     //    adBuryData_Banner.adTeam.Add(_adTeam);
     //    adBuryData_Banner.adPlayType.Add(AdPlayType.Banner.ToString());
     //    adBuryData_Banner.playResult.Add("0");
     //    adBuryData_Banner.closeTime = "";
     //}
     //else
     //{
     //    adBuryData.playResult.Add("0");
     //    adBuryData.closeTime = "";
     //}
     //if (_failed == "no")
     //{
     //    if (_AdPlayType == AdPlayType.Banner)
     //    {
     //        adBuryData_Banner.failed.Add("no can used team");
     //        UpLoad(adBuryData_Banner);
     //    }
     //    else
     //    {
     //        adBuryData.failed.Add("no can used team");
     //        UpLoad(adBuryData);
     //    }
     //}
     //else
     //{
     //    if (_AdPlayType == AdPlayType.Banner)
     //        adBuryData_Banner.failed.Add(_failed);
     //    else
     //        adBuryData.failed.Add(_failed);
     //}
 }