示例#1
0
 public override void doRequest()
 {
     base.LogFunc("doRequest()");
     AdsRequestHelper.DebugLog("MoPub.RequestInterstitialAd(" + base.adUnitId + ")");
     MoPubAndroid.RequestInterstitialAd(base.adUnitId, string.Empty, string.Empty);
     base.callback.onRequest(this, "Mopub");
 }
示例#2
0
 public static void Init(AdsConfiguration config, Action <string> onComplete = null)
 {
     if (inst == null)
     {
         DebugLog("AdsRequestHelper.Init()");
         try
         {
             DebugLog("MoPub.InitializeSdk()");
             if (onComplete != null)
             {
                 MoPubManager.OnSdkInitializedEvent += onComplete;
             }
             MoPubBase.SdkConfiguration sdkConfiguration = new MoPubBase.SdkConfiguration {
                 AdUnitId = config.mopubRewarded,
                 LogLevel = MoPubBase.LogLevel.MPLogLevelDebug
             };
             sdkConfiguration.MediatedNetworks = new MoPubBase.MediatedNetwork[] { new MoPubBase.SupportedNetwork.AdMob(), new MoPubBase.SupportedNetwork.AppLovin(), new MoPubBase.SupportedNetwork.Facebook(), new MoPubBase.SupportedNetwork.IronSource(), new MoPubBase.SupportedNetwork.Unity() };
             MoPubAndroid.InitializeSdk(sdkConfiguration);
             DebugLog("MoPub.LoadRewardedVideoPluginsForAdUnits()");
             string[] rewardedVideoAdUnitIds = new string[] { config.mopubRewarded };
             MoPubAndroid.LoadRewardedVideoPluginsForAdUnits(rewardedVideoAdUnitIds);
             Type[]     components = new Type[] { typeof(AdsRequestHelper) };
             GameObject target     = new GameObject("AdsHelperObject", components);
             Object.DontDestroyOnLoad(target);
             inst        = target.GetComponent <AdsRequestHelper>();
             inst.config = config;
         }
         catch (Exception exception)
         {
             Debug.LogException(exception);
         }
     }
 }
示例#3
0
    private void Start()
    {
        _Instance = this;
        ResourceManager.Init();
        GameConfig.Init();
        SdkManager.set_first_setup_time();
        SdkManager.send_event("app_start");
        LocalModelManager.Instance.Stage_Level_chapter1.Init();
        LocalModelManager.Instance.Equip_equip.Init();
        LocalModelManager.Instance.Character_Level.Init();
        LocalModelManager.Instance.Stage_Level_stagechapter.Init();
        LocalModelManager.Instance.Stage_Level_activitylevel.Init();
        LocalModelManager.Instance.Stage_Level_activity.Init();
        LocalModelManager.Instance.Achieve_Achieve.Init();
        LocalModelManager.Instance.Shop_MysticShop.Init();
        CInstance <PlayerPrefsMgr> .Instance.Init();

        AdsRequestHelper.Init();
        AdsRequestHelper.getRewardedAdapter().isLoaded();
        LocalSave.Instance.InitData();
        LocalSave.Instance.BattleIn_CheckInit();
        GameLogic.Hold.Guide.Init();
        this._InitNameGenerator();
        SdkManager.InitSdks();
        Debug.unityLogger.logEnabled = false;
        NetManager.mNetCache.Init();
        NetManager.StartPing();
        WindowUI.Init();
        this._InitPureMVC();
    }
示例#4
0
    private void onClickButtonInternal(int count)
    {
        bool flag  = false;
        bool flag2 = false;

        if (LocalSave.Instance.GetDiamondBoxFreeCount(base.mBoxType) > 0)
        {
            flag  = true;
            flag2 = true;
        }
        else
        {
            count = MathDxx.Clamp(count, 0, base.mTransfer.diamonds.Length - 1);
            if (base.CheckCanOpen(2, this.get_price(count)))
            {
                flag2 = true;
            }
        }
        if (flag2)
        {
            if (LocalSave.Instance.GetTimeBoxCount(LocalSave.TimeBoxType.BoxChoose_DiamondNormal) > 0)
            {
                SdkManager.send_event_ad(ADSource.eDiamondNormal, "CLICK", 0, 0, string.Empty, string.Empty);
            }
            if (!NetManager.IsNetConnect)
            {
                CInstance <TipsUIManager> .Instance.Show(ETips.Tips_NetError, Array.Empty <string>());

                if (LocalSave.Instance.GetTimeBoxCount(LocalSave.TimeBoxType.BoxChoose_DiamondNormal) > 0)
                {
                    SdkManager.send_event_ad(ADSource.eDiamondNormal, "IMPRESSION", 0, 0, "FAIL", "NET_ERROR");
                }
            }
            else if (LocalSave.Instance.GetTimeBoxCount(LocalSave.TimeBoxType.BoxChoose_DiamondNormal) > 0)
            {
                if (LocalSave.Instance.IsAdFree())
                {
                    this.send_get_box();
                }
                else if (!AdsRequestHelper.getRewardedAdapter().isLoaded())
                {
                    SdkManager.send_event_ad(ADSource.eDiamondNormal, "IMPRESSION", 0, 0, "FAIL", "AD_NOT_READY");
                    WindowUI.ShowAdInsideUI(AdInsideProxy.EnterSource.eGameTurn, delegate {
                        SdkManager.send_event_ad(ADSource.eDiamondNormal, "REWARD", 0, 0, "INSIDE", string.Empty);
                        this.send_get_box();
                    });
                }
                else
                {
                    AdsRequestHelper.getRewardedAdapter().Show(this);
                    SdkManager.send_event_ad(ADSource.eDiamondNormal, "IMPRESSION", 0, 0, "SUCCESS", string.Empty);
                }
            }
            else
            {
                this.send_get_box();
            }
        }
    }
示例#5
0
 public void onRequest(AdsRequestHelper.AdsDriver sender, string networkName)
 {
     AdsRequestHelper.DebugLog("CallbackRouter.onRequest(" + this.callbacks.Count + ")");
     foreach (AdsRequestHelper.AdsCallback callback in this.callbacks)
     {
         callback.onRequest(sender, networkName);
     }
 }
示例#6
0
 public void onFail(AdsRequestHelper.AdsDriver sender, string msg)
 {
     AdsRequestHelper.DebugLog("CallbackRouter.onFail(" + this.callbacks.Count + ")");
     foreach (AdsRequestHelper.AdsCallback callback in this.callbacks)
     {
         callback.onFail(sender, msg);
     }
 }
    public void Open()
    {
        this.show_close(false);
        AdsRequestHelper.getRewardedAdapter().AddCallback(this);
        if (LocalSave.Instance.IsAdFree())
        {
            this.Image_Ad.enabled = false;
            this.Text_Turn.get_rectTransform().anchoredPosition = new Vector2(0f, this.Text_Turn.get_rectTransform().anchoredPosition.y);
        }
        else
        {
            this.Image_Ad.enabled = true;
            this.Text_Turn.get_rectTransform().anchoredPosition = new Vector2(this.Text_TurnX, this.Text_Turn.get_rectTransform().anchoredPosition.y);
        }
        object[] args = new object[] { GameLogic.Hold.Language.GetLanguageByTID("key_ad_count", Array.Empty <object>()), LocalSave.Instance.BattleAd_Get() };
        this.Text_Last.text = Utils.FormatString("{0}: {1}", args);
        this.bStartTurn     = false;
        GameLogic.Hold.Sound.PlayUI(0xf4244);
        this.Button_Cancel.onClick = delegate {
            if (this.onClickClose != null)
            {
                this.onClickClose();
            }
        };
        this.Button_Ad.SetDepondNet(true);
        this.Button_Ad.onClick = delegate {
            this.bAdReward = false;
            SdkManager.send_event_ad(ADSource.eTurntable, "CLICK", 0, 0, string.Empty, string.Empty);
            if (!NetManager.IsNetConnect)
            {
                CInstance <TipsUIManager> .Instance.Show(ETips.Tips_NetError, Array.Empty <string>());

                SdkManager.send_event_ad(ADSource.eTurntable, "IMPRESSION", 0, 0, "FAIL", "NET_ERROR");
            }
            else if (LocalSave.Instance.IsAdFree())
            {
                this.show_button(false);
                this.mTurnCtrl.Init();
            }
            else if (!AdsRequestHelper.getRewardedAdapter().isLoaded())
            {
                SdkManager.send_event_ad(ADSource.eTurntable, "IMPRESSION", 0, 0, "FAIL", "AD_NOT_READY");
                WindowUI.ShowAdInsideUI(AdInsideProxy.EnterSource.eGameTurn, delegate {
                    this.show_button(false);
                    this.mTurnCtrl.Init();
                });
            }
            else
            {
                SdkManager.send_event_ad(ADSource.eTurntable, "IMPRESSION", 0, 0, "SUCCESS", string.Empty);
                AdsRequestHelper.getRewardedAdapter().Show(this);
            }
        };
        this.show_button(true);
        this.InitUI();
    }
示例#8
0
 public void RemoveCallback(AdsRequestHelper.AdsCallback callback)
 {
     AdsRequestHelper.DebugLog("DummyAdapter.RemoveCallback()");
     if (this.adapter != null)
     {
         this.adapter.RemoveCallback(callback);
     }
     else
     {
         this.callbacks.Remove(callback);
     }
 }
示例#9
0
 public void SetAdapter(AdsRequestHelper.AdsAdapter adapter)
 {
     AdsRequestHelper.DebugLog("DummyAdapter.SetAdapter()");
     foreach (AdsRequestHelper.AdsCallback callback in this.callbacks)
     {
         adapter.AddCallback(callback);
     }
     this.callbacks.Clear();
     if (this.config != null)
     {
         adapter.UpdateConfig(this.config);
         this.config = null;
     }
     this.adapter = adapter;
 }
示例#10
0
 public void AddCallback(AdsRequestHelper.AdsCallback callback)
 {
     AdsRequestHelper.DebugLog("DummyAdapter.AddCallback()");
     try
     {
         if (this.adapter != null)
         {
             this.adapter.AddCallback(callback);
         }
         else
         {
             this.callbacks.Add(callback);
         }
     }
     catch (Exception exception)
     {
         Debug.LogException(exception);
     }
 }
示例#11
0
 protected override void OnInit()
 {
     this.bWatchEnd = false;
     LocalSave.Instance.mGuideData.CheckDiamondBox(base.NotFreeParent.transform as RectTransform, 1);
     this.mData = LocalModelManager.Instance.Box_SilverNormalBox.GetBeanById(LocalSave.Instance.Stage_GetStage());
     base.mTransfer.diamonds = this.mData.Price1;
     base.PerTime            = this.mData.Time * 60;
     base.mGoldCtrl.SetValue(this.get_price(0));
     base.FreeShow(false);
     base.UpdateBox();
     if (LocalSave.Instance.IsAdFree())
     {
         this.Image_Ad.enabled = false;
         base.Text_Free.get_rectTransform().anchoredPosition = new Vector2(0f, base.Text_Free.get_rectTransform().anchoredPosition.y);
     }
     else
     {
         this.Image_Ad.enabled = true;
         base.Text_Free.get_rectTransform().anchoredPosition = new Vector2(base.Text_FreeX, base.Text_Free.get_rectTransform().anchoredPosition.y);
     }
     AdsRequestHelper.getRewardedAdapter().RemoveCallback(this);
     AdsRequestHelper.getRewardedAdapter().AddCallback(this);
 }
示例#12
0
 public void onReward(AdsRequestHelper.AdsDriver sender, string networkName)
 {
     if (this.exclusiveCallback != null)
     {
         if (this.callbacks.Contains(this.exclusiveCallback))
         {
             AdsRequestHelper.DebugLog("CallbackRouter.onReward()");
             this.exclusiveCallback.onReward(sender, networkName);
         }
         else
         {
             AdsRequestHelper.DebugLog("CallbackRouter.onReward(null)");
         }
     }
     else
     {
         AdsRequestHelper.DebugLog("CallbackRouter.onReward(" + this.callbacks.Count + ")");
         foreach (AdsRequestHelper.AdsCallback callback in this.callbacks)
         {
             callback.onReward(sender, networkName);
         }
     }
 }
 public void onFail(AdsRequestHelper.AdsDriver sender, string msg)
 {
     AdsRequestHelper.DebugLog("AdTurnTableCtrl onFail");
 }
示例#14
0
 public void onFail(AdsRequestHelper.AdsDriver sender, string msg)
 {
     AdsRequestHelper.DebugLog("DiamondNormal onFail");
 }
 public void onClose(AdsRequestHelper.AdsDriver sender, string networkName)
 {
     AdsRequestHelper.DebugLog("AdTurnTableCtrl onClose");
     TweenSettingsExtensions.AppendCallback(TweenSettingsExtensions.AppendInterval(DOTween.Sequence(), 0.1f), new TweenCallback(this, this.< onClose > m__3));
 }
示例#16
0
 public bool Show(AdsRequestHelper.AdsCallback enabledCallback)
 {
     AdsRequestHelper.DebugLog("DummyAdapter.Show(callback)");
     return((this.adapter != null) && this.adapter.Show(enabledCallback));
 }
示例#17
0
 public void onClick(AdsRequestHelper.AdsDriver sender, string networkName)
 {
     AdsRequestHelper.DebugLog("DiamondNormal onClick");
 }
示例#18
0
 public bool Show()
 {
     AdsRequestHelper.DebugLog("DummyAdapter.Show()");
     return((this.adapter != null) && this.adapter.Show());
 }
示例#19
0
 public void LogFunc(string log)
 {
     AdsRequestHelper.DebugLog(this.getName() + "." + log);
 }
示例#20
0
 public void AddCallback(AdsRequestHelper.AdsCallback callback)
 {
     AdsRequestHelper.DebugLog("CallbackRouter.AddCallback()");
     this.callbacks.Add(callback);
 }
示例#21
0
 protected override void OnDeinit()
 {
     AdsRequestHelper.getRewardedAdapter().RemoveCallback(this);
 }
 public void onRequest(AdsRequestHelper.AdsDriver sender, string networkName)
 {
     AdsRequestHelper.DebugLog("AdTurnTableCtrl onRequest");
 }
 public void onReward(AdsRequestHelper.AdsDriver sender, string networkName)
 {
     AdsRequestHelper.DebugLog("AdTurnTableCtrl onReward");
     this.show_button(false);
     this.mTurnCtrl.Init();
 }
示例#24
0
 public void RemoveCallback(AdsRequestHelper.AdsCallback callback)
 {
     AdsRequestHelper.DebugLog("CallbackRouter.RemoveCallback()");
     this.callbacks.Remove(callback);
 }
 public void Deinit()
 {
     AdsRequestHelper.getRewardedAdapter().RemoveCallback(this);
 }
示例#26
0
 public void onFail(AdsRequestHelper.AdsDriver sender, string msg)
 {
     AdsRequestHelper.DebugLog("Key onFail");
 }