a面提交
This commit is contained in:
@@ -99,22 +99,19 @@ public class AdRedeemManager
|
||||
bool is_get = item.Key == PurchasingManager.GetPaySku(PayType.pack_reward) && SaveData.GetSaveObject().is_get_packreward;
|
||||
bool is_get1 = item.Key == PurchasingManager.GetPaySku(PayType.remove_ad) && SaveData.GetSaveObject().is_get_removead;
|
||||
|
||||
if (is_get || is_get1)
|
||||
if (item.Key == PurchasingManager.GetPaySku(PayType.pack_reward) || item.Key == PurchasingManager.GetPaySku(PayType.remove_ad)) return;
|
||||
if (GameHelper.GetNowTime() < lastTimes && !checkIsCanReceive(item.Key))
|
||||
{
|
||||
item.Value.enabled = false;
|
||||
}
|
||||
else if (GameHelper.GetNowTime() < lastTimes && !checkIsCanReceive(item.Key))
|
||||
{
|
||||
item.Value.enabled = false;
|
||||
item.Value.can_buy.selectedIndex = btn_watchAd.Can_buy_cd;
|
||||
item.Value.btn_text.text = CommonHelper.TimeFormat(lastTimes - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
item.Value.can_buy.selectedIndex = btn_watchAd.Can_buy_cd;
|
||||
}
|
||||
else
|
||||
{
|
||||
// stopAction();
|
||||
item.Value.enabled = true;
|
||||
item.Value.can_buy.selectedIndex = btn_watchAd.Can_buy_can;
|
||||
checkBtnState(item.Value, item.Key);
|
||||
item.Value.can_buy.selectedIndex = btn_watchAd.Can_buy_can;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ using IgnoreOPS;
|
||||
using SGModule.Net;
|
||||
using IgnoreOPS;
|
||||
using SGModule.NetKit;
|
||||
using Unity.VisualScripting;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
@@ -103,13 +104,38 @@ namespace ChillConnect
|
||||
|
||||
|
||||
list = ConfigSystem.GetConfig<PaidgiftModel>().DataList;
|
||||
if (!GameHelper.IsGiftSwitch())
|
||||
{
|
||||
list[0].Paid_price = 1;
|
||||
list[1].Paid_price = 1;
|
||||
}
|
||||
|
||||
if (GameHelper.IsAdModelOfPay())
|
||||
{
|
||||
AdRedeemManager.Instance.SetWatchAd(PurchasingManager.GetPaySku(PayType.pack_reward),
|
||||
ui.panel_parent.panel.btn_buypack as btn_watchAd, SetTextString1);
|
||||
AdRedeemManager.Instance.SetWatchAd(PurchasingManager.GetPaySku(PayType.remove_ad),
|
||||
ui.panel_parent.panel.btn_buyremovead as btn_watchAd, SetTextString1);
|
||||
// if (!GameHelper.IsGiftSwitch())
|
||||
// {
|
||||
// if (SaveData.GetSaveObject().is_get_packreward)
|
||||
// {
|
||||
|
||||
// }
|
||||
// ui.panel_parent.panel.btn_buypack.SetClick(() =>
|
||||
// {
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.apple_pay_success, PurchasingManager.GetPaySku(PayType.pack_reward));
|
||||
// InitView();
|
||||
// });
|
||||
// ui.panel_parent.panel.btn_buyremovead.SetClick(() =>
|
||||
// {
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.apple_pay_success, PurchasingManager.GetPaySku(PayType.remove_ad));
|
||||
// InitView();
|
||||
// });
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// AdRedeemManager.Instance.SetWatchAd(PurchasingManager.GetPaySku(PayType.pack_reward),
|
||||
// ui.panel_parent.panel.btn_buypack as btn_watchAd, SetTextString1);
|
||||
// AdRedeemManager.Instance.SetWatchAd(PurchasingManager.GetPaySku(PayType.remove_ad),
|
||||
// ui.panel_parent.panel.btn_buyremovead as btn_watchAd, SetTextString1);
|
||||
// }
|
||||
}
|
||||
HallManager.Instance.UpdateEvent += InitView;
|
||||
InitView();
|
||||
@@ -218,6 +244,13 @@ namespace ChillConnect
|
||||
|
||||
private void InitView()
|
||||
{
|
||||
if (!GameHelper.IsGiftSwitch())
|
||||
{
|
||||
ConfigSystem.GetConfig<PaidgiftModel>().DataList[0].Paid_price = 1;
|
||||
ConfigSystem.GetConfig<PaidgiftModel>().DataList[1].Paid_price = 1;
|
||||
list= ConfigSystem.GetConfig<PaidgiftModel>().DataList;
|
||||
}
|
||||
|
||||
gold_num = list[0].coins_quantity;
|
||||
back_num = list[0].props_quantity[1];
|
||||
out_num = list[0].props_quantity[0];
|
||||
@@ -302,21 +335,134 @@ namespace ChillConnect
|
||||
SetTextString1();
|
||||
}
|
||||
ui.panel_parent.panel.btn_max_remove.grayed = false;
|
||||
|
||||
if (GameHelper.IsAdModelOfPay())
|
||||
{
|
||||
if (SaveData.GetSaveObject()._watch_ad_cd > GameHelper.GetNowTime())
|
||||
|
||||
if (SaveData.GetSaveObject().is_get_packreward)
|
||||
{
|
||||
// (ui.panel_parent.panel.btn_buyremovead as btn_watchAd).buy_state.selectedIndex = 0;
|
||||
(ui.panel_parent.panel.btn_buyremovead as btn_watchAd).can_buy.selectedIndex = 1;
|
||||
(ui.panel_parent.panel.btn_buyremovead as btn_watchAd).btn_text.text = CommonHelper.TimeFormat((int)SaveData.GetSaveObject()._watch_ad_cd - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
(ui.panel_parent.panel.btn_buypack as btn_watchAd).buy_state.selectedIndex = 1;
|
||||
(ui.panel_parent.panel.btn_buypack as btn_watchAd).title = "Received";
|
||||
(ui.panel_parent.panel.btn_buypack as btn_watchAd).enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log(AdRedeemManager.Instance.GetLookRewardADNum());
|
||||
Debug.Log(ConfigSystem.GetConfig<PaidgiftModel>().DataList[0].Paid_price);
|
||||
if (AdRedeemManager.Instance.GetLookRewardADNum() >= ConfigSystem.GetConfig<PaidgiftModel>().DataList[0].Paid_price)
|
||||
{
|
||||
(ui.panel_parent.panel.btn_buypack as btn_watchAd).enabled = true;
|
||||
(ui.panel_parent.panel.btn_buypack as btn_watchAd).buy_state.selectedIndex = 1;
|
||||
(ui.panel_parent.panel.btn_buypack as btn_watchAd).title = "Receive";
|
||||
ui.panel_parent.panel.btn_buypack.SetClick(() =>
|
||||
{
|
||||
AdRedeemData adRedeemData = new AdRedeemData
|
||||
{
|
||||
type = PurchasingManager.GetPaySku(PayType.pack_reward),
|
||||
ad_count = AdRedeemManager.Instance.GetCeilingNeedAds(PurchasingManager.GetPaySku(PayType.pack_reward))
|
||||
};
|
||||
AdRedeemManager.Instance.Redeem(adRedeemData);
|
||||
});
|
||||
}
|
||||
else if (SaveData.GetSaveObject()._watch_ad_cd > GameHelper.GetNowTime())
|
||||
{
|
||||
(ui.panel_parent.panel.btn_buypack as btn_watchAd).enabled = false;
|
||||
(ui.panel_parent.panel.btn_buypack as btn_watchAd).buy_state.selectedIndex = 0;
|
||||
(ui.panel_parent.panel.btn_buypack as btn_watchAd).can_buy.selectedIndex = 1;
|
||||
(ui.panel_parent.panel.btn_buypack as btn_watchAd).btn_text.text = CommonHelper.TimeFormat((int)SaveData.GetSaveObject()._watch_ad_cd - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
}
|
||||
else
|
||||
{
|
||||
(ui.panel_parent.panel.btn_buypack as btn_watchAd).enabled = true;
|
||||
(ui.panel_parent.panel.btn_buypack as btn_watchAd).buy_state.selectedIndex = 0;
|
||||
(ui.panel_parent.panel.btn_buypack as btn_watchAd).can_buy.selectedIndex = 0;
|
||||
ui.panel_parent.panel.btn_buypack.SetClick(() =>
|
||||
{
|
||||
GameHelper.ShowVideoAd("buy_add_one", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
var ad_times = Convert.ToInt32(GameHelper.GetNowTime());
|
||||
SaveData.GetSaveObject()._watch_ad_cd = ad_times + ConfigSystem.GetConfig<CommonModel>().exchangeCD;
|
||||
InitView();
|
||||
}
|
||||
});
|
||||
// AdRedeemManager.Instance.SendEventClickByName(PurchasingManager.GetPaySku(PayType.pack_reward), "click");
|
||||
// AdRedeemManager.Instance.ShowVideoAd("buy_add_one", () =>
|
||||
// {
|
||||
// TimerHelper.mEasy.AddTimer(0.1f, () =>
|
||||
// {
|
||||
// var ad_times = Convert.ToInt32(GameHelper.GetNowTime());
|
||||
// SaveData.GetSaveObject()._watch_ad_cd = ad_times + ConfigSystem.GetConfig<CommonModel>().exchangeCD;
|
||||
// InitView();
|
||||
// });
|
||||
// });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
else if (SaveData.GetSaveObject().remove_ad_time > GameHelper.GetNowTime())
|
||||
|
||||
if (SaveData.GetSaveObject().is_get_removead && GameHelper.GetNowTime() < SaveData.GetSaveObject().remove_ad_time)
|
||||
{
|
||||
(ui.panel_parent.panel.btn_buyremovead as btn_watchAd).buy_state.selectedIndex = 0;
|
||||
(ui.panel_parent.panel.btn_buyremovead as btn_watchAd).can_buy.selectedIndex = 1;
|
||||
(ui.panel_parent.panel.btn_buyremovead as btn_watchAd).btn_text.text = CommonHelper.TimeFormat((int)SaveData.GetSaveObject().remove_ad_time - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
(ui.panel_parent.panel.btn_buyremovead as btn_watchAd).btn_text.text = CommonHelper.TimeFormat(SaveData.GetSaveObject().remove_ad_time - (int)GameHelper.GetNowTime(), CountDownType.Hour);
|
||||
(ui.panel_parent.panel.btn_buyremovead as btn_watchAd).enabled = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (AdRedeemManager.Instance.GetLookRewardADNum() >= ConfigSystem.GetConfig<PaidgiftModel>().DataList[1].Paid_price)
|
||||
{
|
||||
(ui.panel_parent.panel.btn_buyremovead as btn_watchAd).enabled = true;
|
||||
(ui.panel_parent.panel.btn_buyremovead as btn_watchAd).buy_state.selectedIndex = 1;
|
||||
(ui.panel_parent.panel.btn_buyremovead as btn_watchAd).title = "Receive";
|
||||
ui.panel_parent.panel.btn_buyremovead.SetClick(() =>
|
||||
{
|
||||
AdRedeemData adRedeemData = new AdRedeemData
|
||||
{
|
||||
type = PurchasingManager.GetPaySku(PayType.remove_ad),
|
||||
ad_count = AdRedeemManager.Instance.GetCeilingNeedAds(PurchasingManager.GetPaySku(PayType.remove_ad))
|
||||
};
|
||||
AdRedeemManager.Instance.Redeem(adRedeemData);
|
||||
});
|
||||
}
|
||||
else if (SaveData.GetSaveObject()._watch_ad_cd > GameHelper.GetNowTime())
|
||||
{
|
||||
(ui.panel_parent.panel.btn_buyremovead as btn_watchAd).enabled = false;
|
||||
(ui.panel_parent.panel.btn_buyremovead as btn_watchAd).buy_state.selectedIndex = 0;
|
||||
(ui.panel_parent.panel.btn_buyremovead as btn_watchAd).can_buy.selectedIndex = 1;
|
||||
(ui.panel_parent.panel.btn_buyremovead as btn_watchAd).btn_text.text = CommonHelper.TimeFormat((int)SaveData.GetSaveObject()._watch_ad_cd - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
}
|
||||
else
|
||||
{
|
||||
(ui.panel_parent.panel.btn_buyremovead as btn_watchAd).enabled = true;
|
||||
(ui.panel_parent.panel.btn_buyremovead as btn_watchAd).buy_state.selectedIndex = 0;
|
||||
(ui.panel_parent.panel.btn_buyremovead as btn_watchAd).can_buy.selectedIndex = 0;
|
||||
ui.panel_parent.panel.btn_buyremovead.SetClick(() =>
|
||||
{
|
||||
GameHelper.ShowVideoAd("buy_add_one", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
var ad_times = Convert.ToInt32(GameHelper.GetNowTime());
|
||||
SaveData.GetSaveObject()._watch_ad_cd = ad_times + ConfigSystem.GetConfig<CommonModel>().exchangeCD;
|
||||
InitView();
|
||||
}
|
||||
});
|
||||
// AdRedeemManager.Instance.ShowVideoAd("buy_add_one", () =>
|
||||
// {
|
||||
// TimerHelper.mEasy.AddTimer(0.1f, () =>
|
||||
// {
|
||||
// var ad_times = Convert.ToInt32(GameHelper.GetNowTime());
|
||||
// SaveData.GetSaveObject()._watch_ad_cd = ad_times + ConfigSystem.GetConfig<CommonModel>().exchangeCD;
|
||||
// InitView();
|
||||
// });
|
||||
// });
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace ChillConnect
|
||||
DOVirtual.DelayedCall(0.5f, () =>
|
||||
{
|
||||
int gold = 0;
|
||||
GameHelper.ShowTips("Purchase successful");
|
||||
if(!GameHelper.IsGiftSwitch()) GameHelper.ShowTips("Purchase successful");
|
||||
|
||||
List<Passportrewards> Passportrewards_list = ConfigSystem.GetConfig<PassportrewardsModel>().DataList;
|
||||
for (int i = 0; i < Passportrewards_list.Count; i++)
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace ChillConnect
|
||||
SaveData.GetSaveObject().have_slot = true;
|
||||
SaveData.saveDataFunc();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Slot_refresh);
|
||||
GameHelper.ShowTips("Purchase successful");
|
||||
if (!GameHelper.IsGiftSwitch()) GameHelper.ShowTips("Purchase successful");
|
||||
GameHelper.IsTemporaryEnd = false;
|
||||
purch_number = ConfigSystem.GetConfig<CommonModel>().addspace2.ToString();
|
||||
}
|
||||
@@ -128,7 +128,7 @@ namespace ChillConnect
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Slot_refresh);
|
||||
}
|
||||
GameHelper.IsTemporaryEnd = false;
|
||||
GameHelper.ShowTips("Purchase successful");
|
||||
if (!GameHelper.IsGiftSwitch()) GameHelper.ShowTips("Purchase successful");
|
||||
}
|
||||
else if (type == PurchasingManager.GetPaySku(PayType.remove_ad))
|
||||
{
|
||||
@@ -139,7 +139,7 @@ namespace ChillConnect
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.noads_refresh);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.UpdateNoads);
|
||||
GameHelper.ShowTips("Purchase successful");
|
||||
if (!GameHelper.IsGiftSwitch()) GameHelper.ShowTips("Purchase successful");
|
||||
purch_number = ConfigSystem.GetConfig<PaidgiftModel>().DataList[1].Paid_price2.ToString();
|
||||
}
|
||||
else if (type == PurchasingManager.GetPaySku(PayType.pack_reward))
|
||||
@@ -160,7 +160,7 @@ namespace ChillConnect
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Sheep_item_refresh);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.UpdateNoads);
|
||||
GameHelper.ShowTips("Purchase successful");
|
||||
if (!GameHelper.IsGiftSwitch()) GameHelper.ShowTips("Purchase successful");
|
||||
purch_number = ConfigSystem.GetConfig<PaidgiftModel>().DataList[0].Paid_price2.ToString();
|
||||
}
|
||||
else if (type == PurchasingManager.GetPaySku(PayType.battle_pass))
|
||||
|
||||
@@ -273,8 +273,9 @@ namespace ChillConnect
|
||||
{
|
||||
if (!GameHelper.IsGiftSwitch())
|
||||
{
|
||||
list = list.GetRange(0, 2);
|
||||
list[1].Payment_amount = 1;
|
||||
ConfigSystem.GetConfig<PaidcoinsModel>().DataList = ConfigSystem.GetConfig<PaidcoinsModel>().DataList.GetRange(0, 2);
|
||||
ConfigSystem.GetConfig<PaidcoinsModel>().DataList[1].Payment_amount = 1;
|
||||
list=ConfigSystem.GetConfig<PaidcoinsModel>().DataList;
|
||||
}
|
||||
ui.gold_list.itemRenderer = setRemaintime;
|
||||
ui.gold_list.numItems = list.Count > 6 ? 6 : list.Count;
|
||||
|
||||
Reference in New Issue
Block a user