// *********************************************************************** // Assembly : Game // Author : Kimch // Created : 2021-12-23 // Description : // Last Modified By : // Last Modified On : // *********************************************************************** // // // *********************************************************************** using System.Collections; using System.Collections.Generic; using UnityEngine; namespace G { /// /// /// public class AdProxy : F.GameProxy { #region Field #endregion #region Method /// /// /// /// /// /// public void PlayAd(string type, string name, Callback2 callback) { if (RmbShopProxy.Instance.IsActivitionCard() == 4) { MissionProxy.Instance.OnEvent(MissionProxy.观看视频次数); callback?.Invoke(0, "ad_forever"); UI.ToastBox.ShowText(LanguageProxy.Instance.GetLocalString(100), 10); #if UNITY_EDITOR Debug.Log("免广告特权周卡"); #endif return; } if (RmbShopProxy.Instance.IsActivitionCard() == 3) { MissionProxy.Instance.OnEvent(MissionProxy.观看视频次数); callback?.Invoke(0, "ad_week"); UI.ToastBox.ShowText(LanguageProxy.Instance.GetLocalString(101), 11); #if UNITY_EDITOR Debug.Log("免广告特权永久卡"); #endif return; } if (MoneyProxy.Instance.CheckAndCostMoney(new Item.ItemInfo(Item.Id.kAdTicket, 1))) { MissionProxy.Instance.OnEvent(MissionProxy.观看视频次数); callback?.Invoke(0, "ad_ticket"); #if UNITY_EDITOR Debug.Log("免广告券"); #endif } else { _stageDict.TryGetValue(name, out var scene); KPlatform.Instance.PlayRewardAd(type, scene, callback); } } public void PlayAdChange(string type, string name, Callback2 callback) { if (RmbShopProxy.Instance.IsActivitionCard() ==4) { MissionProxy.Instance.OnEvent(MissionProxy.观看视频次数); callback?.Invoke(0, "ad_forever"); UI.ToastBox.ShowText(LanguageProxy.Instance.GetLocalString(100), 10); #if UNITY_EDITOR Debug.Log("免广告特权周卡"); #endif return; } if (RmbShopProxy.Instance.IsActivitionCard() == 3) { MissionProxy.Instance.OnEvent(MissionProxy.观看视频次数); callback?.Invoke(0, "ad_week"); UI.ToastBox.ShowText(LanguageProxy.Instance.GetLocalString(101), 11); #if UNITY_EDITOR Debug.Log("免广告特权永久卡"); #endif return; } if (MoneyProxy.Instance.CheckAndCostMoney(new Item.ItemInfo(Item.Id.kAdTicket, 1))) { MissionProxy.Instance.OnEvent(MissionProxy.观看视频次数); callback?.Invoke(0, "ad_ticket"); #if UNITY_EDITOR Debug.Log("免广告券"); #endif } else { _stageDict.TryGetValue(name, out var scene); KPlatform.Instance.PlayRewardAd(type, scene, callback); } } Dictionary _stageDict = new Dictionary { { "ads_skill_refresh","1"}, { "ads_skill_study_all","2"}, { "settle","3"}, { "ads_skill_study_double","4"}, { "ads_advt_try","6"}, { "ads_advt_buff","7"}, { "ads_advt_moves","8"}, { "revive","9"}, { "sign_in_double","10"}, { "vip_ad_daily","11"}, { "ads_affair_reward","12"}, { "first_ad","13"}, { "ads_at_free_energy","14"}, { "ad_instant_level","15"}, { "ads_gains","16"}, { "ads_pet_feed","17"}, { "refresh_exchange","18"}, { "ads_prop_box","19"}, { "ads_exchange","20"}, { "ads_coin","21"}, { "ads_chip","22"}, { "ads_gem","23"}, { "ads_energy","24"}, { "ads_motion","25"}, }; /// /// /// /// /// /// /// public void PlayAd(string type, string name, string stage, Callback2 callback) { if (RmbShopProxy.Instance.IsActivitionCard() == 4) { MissionProxy.Instance.OnEvent(MissionProxy.观看视频次数); callback?.Invoke(0, "ad_forever"); UI.ToastBox.ShowText(LanguageProxy.Instance.GetLocalString(100), 10); #if UNITY_EDITOR Debug.Log("免广告特权周卡"); #endif return; } if (RmbShopProxy.Instance.IsActivitionCard() == 3) { MissionProxy.Instance.OnEvent(MissionProxy.观看视频次数); callback?.Invoke(0, "ad_week"); UI.ToastBox.ShowText(LanguageProxy.Instance.GetLocalString(101), 11); #if UNITY_EDITOR Debug.Log("免广告特权永久卡"); #endif return; } _stageDict.TryGetValue(name, out var scene); KPlatform.Instance.PlayRewardAd(type, scene, stage, callback); } #endregion #region Unity && Proxy public static AdProxy Instance => GetInstance(); #endregion } }