|
|
|
@@ -1,17 +1,16 @@
|
|
|
|
|
// using FGUI.A000_common;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using DG.Tweening;
|
|
|
|
|
using FairyGUI;
|
|
|
|
|
using FGUI.P01_Common;
|
|
|
|
|
using FGUI.LG_Common;
|
|
|
|
|
using SGModule.Common.Extensions;
|
|
|
|
|
|
|
|
|
|
namespace FlowerPower
|
|
|
|
|
namespace LoveLegend
|
|
|
|
|
{
|
|
|
|
|
public class RewardboxUI : BaseUI
|
|
|
|
|
{
|
|
|
|
|
private RewardboxUICtrl ctrl;
|
|
|
|
|
private RewardboxModel model;
|
|
|
|
|
private FGUI.P08_Play.com_rewardbox ui;
|
|
|
|
|
private float ch_num;
|
|
|
|
|
private FGUI.ZM_Game_04.com_rewardbox ui;
|
|
|
|
|
|
|
|
|
|
public RewardboxUI(RewardboxUICtrl ctrl) : base(ctrl)
|
|
|
|
|
{
|
|
|
|
@@ -21,7 +20,7 @@ namespace FlowerPower
|
|
|
|
|
|
|
|
|
|
protected override void SetUIInfo(UIInfo uiInfo)
|
|
|
|
|
{
|
|
|
|
|
uiInfo.packageName = "P08_Play";
|
|
|
|
|
uiInfo.packageName = "ZM_Game_04";
|
|
|
|
|
uiInfo.assetName = "com_rewardbox";
|
|
|
|
|
uiInfo.layerType = UILayerType.Popup;
|
|
|
|
|
uiInfo.isNeedOpenAnim = false;
|
|
|
|
@@ -42,7 +41,7 @@ namespace FlowerPower
|
|
|
|
|
|
|
|
|
|
protected override void OnBind()
|
|
|
|
|
{
|
|
|
|
|
ui = baseUI as FGUI.P08_Play.com_rewardbox;
|
|
|
|
|
ui = baseUI as FGUI.ZM_Game_04.com_rewardbox;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnOpenBefore(object args)
|
|
|
|
@@ -50,35 +49,30 @@ namespace FlowerPower
|
|
|
|
|
|
|
|
|
|
if (GameHelper.IsGiftSwitch()) ui.switchgift.selectedIndex = 1;
|
|
|
|
|
else ui.switchgift.selectedIndex = 0;
|
|
|
|
|
// (ui.btn_lookad as btn_tabad).color.selectedIndex = btn_tabad.Color_green;
|
|
|
|
|
|
|
|
|
|
FGUI.ZM_Common_01.btn_claim btnlook = ui.btn_lookad as FGUI.ZM_Common_01.btn_claim;
|
|
|
|
|
|
|
|
|
|
if (SaveData.GetSaveobject().LargeRewardNum < ConfigSystem.GetConfig<CommonModel>().FreeClaims)
|
|
|
|
|
{
|
|
|
|
|
(ui.btn_lookad as btn_claim4).state.selectedIndex = 1;
|
|
|
|
|
}
|
|
|
|
|
else if (ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1)
|
|
|
|
|
{
|
|
|
|
|
(ui.btn_lookad.GetChild("img_saveingpot") as GImage).visible = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) (ui.btn_lookad.GetChild("img_saveingpot") as GImage).visible = true;
|
|
|
|
|
float[] ch_array = GameHelper.GetRewardValue(2);
|
|
|
|
|
if (SaveData.GetSaveObject().LargeRewardNum < ConfigSystem.GetCommonConf().FreeClaims)
|
|
|
|
|
{
|
|
|
|
|
(ui.btn_lookad as FGUI.ZM_Common_01.btn_claim3).state.selectedIndex = 1;
|
|
|
|
|
}
|
|
|
|
|
ui.btn_lookad.SetClick(() =>
|
|
|
|
|
{
|
|
|
|
|
if (SaveData.GetSaveobject().LargeRewardNum < ConfigSystem.GetConfig<CommonModel>().FreeClaims)
|
|
|
|
|
if (SaveData.GetSaveObject().LargeRewardNum < ConfigSystem.GetCommonConf().FreeClaims)
|
|
|
|
|
{
|
|
|
|
|
StartScroll();
|
|
|
|
|
ui.touchable = false;
|
|
|
|
|
ui.btn_lookad.touchable = ui.btn_close.touchable = false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
GameHelper.ShowVideoAd("reward_lobby", isSuccess =>
|
|
|
|
|
GameHelper.ShowVideoAd("RewardBox", isSuccess =>
|
|
|
|
|
{
|
|
|
|
|
if (isSuccess)
|
|
|
|
|
{
|
|
|
|
|
// GameDispatcher.Instance.Dispatch(GameMsg.Ad_success, ch_array[0]);
|
|
|
|
|
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.RewardboxUI_Close);
|
|
|
|
|
StartScroll();
|
|
|
|
|
ui.touchable = false;
|
|
|
|
|
ui.btn_lookad.touchable = ui.btn_close.touchable = false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@@ -89,9 +83,14 @@ namespace FlowerPower
|
|
|
|
|
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.RewardboxUI_Close);
|
|
|
|
|
GameHelper.addInterAdnumber();
|
|
|
|
|
});
|
|
|
|
|
ch_num = ch_array[0];
|
|
|
|
|
if (GameHelper.GetVipPrivilege(Subscription.DoubleChestReward.As<int>()))
|
|
|
|
|
{
|
|
|
|
|
(ui.wheel as wheel).have_vip.selectedIndex = 1;
|
|
|
|
|
}
|
|
|
|
|
cash_num = (int)ch_array[0];
|
|
|
|
|
rate = (int)ch_array[1];
|
|
|
|
|
ui.text_award.text = GameHelper.Get102Str((decimal)ch_num);
|
|
|
|
|
|
|
|
|
|
ui.gold_text.text = cash_num.ToString();
|
|
|
|
|
InitView();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -128,9 +127,9 @@ namespace FlowerPower
|
|
|
|
|
(ui.wheel.GetChild("wheel_") as wheel_).t1.Play(() =>
|
|
|
|
|
{
|
|
|
|
|
rate_idnex++;
|
|
|
|
|
ui.btn_lookad.title = GameHelper.GetValueWithSymbol((decimal)ch_num * boost_array[rate_idnex % 5]);//"$" + ch_num * boost_array[rate_idnex % 5];
|
|
|
|
|
ui.btn_lookad.title = "" + cash_num * boost_array[rate_idnex % 5];
|
|
|
|
|
});
|
|
|
|
|
ui.btn_lookad.title = GameHelper.GetValueWithSymbol((decimal)ch_num * boost_array[rate_idnex]); //"$" + ch_num * boost_array[rate_idnex];
|
|
|
|
|
ui.btn_lookad.title = "" + cash_num * boost_array[rate_idnex];
|
|
|
|
|
|
|
|
|
|
list_1 = new List<item_wheel>() { (ui.wheel.GetChild("wheel_") as wheel_).item_0, (ui.wheel.GetChild("wheel_") as wheel_).item_1, (ui.wheel.GetChild("wheel_") as wheel_).item_2, (ui.wheel.GetChild("wheel_") as wheel_).item_3, (ui.wheel.GetChild("wheel_") as wheel_).item_4, (ui.wheel.GetChild("wheel_") as wheel_).item_5, (ui.wheel.GetChild("wheel_") as wheel_).item_6, (ui.wheel.GetChild("wheel_") as wheel_).item_7, };
|
|
|
|
|
// list_1[2].img_light.visible = true;
|
|
|
|
@@ -141,7 +140,7 @@ namespace FlowerPower
|
|
|
|
|
list_1[i].text_rate.text = "X" + boost_array[i % boost_array.Length];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private float cash_num;
|
|
|
|
|
private int[] boost_array;
|
|
|
|
|
List<item_wheel> list_1;
|
|
|
|
|
private int rate_idnex = 3;
|
|
|
|
@@ -174,7 +173,7 @@ namespace FlowerPower
|
|
|
|
|
(ui.wheel.GetChild("wheel_") as wheel_).t1.Play(() =>
|
|
|
|
|
{
|
|
|
|
|
rate_idnex++;
|
|
|
|
|
ui.btn_lookad.title = GameHelper.GetValueWithSymbol((decimal)ch_num * boost_array[rate_idnex % boost_array.Length]);
|
|
|
|
|
ui.btn_lookad.title = GameHelper.Get101Str((decimal)cash_num * boost_array[rate_idnex % boost_array.Length]);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
(ui.wheel.GetChild("wheel_") as wheel_).t0.Play(Scroll);
|
|
|
|
@@ -195,10 +194,14 @@ namespace FlowerPower
|
|
|
|
|
if (((ui.wheel.GetChild("wheel_") as wheel_).t0.timeScale < 2f) && (list_1[4].text_rate.text == ("X" + rate)))
|
|
|
|
|
{
|
|
|
|
|
//开始领取
|
|
|
|
|
float reward = ch_num * rate;
|
|
|
|
|
float reward = cash_num * rate;
|
|
|
|
|
if (GameHelper.GetVipPrivilege(Subscription.DoubleChestReward.As<int>()))
|
|
|
|
|
{
|
|
|
|
|
reward *= 2;
|
|
|
|
|
}
|
|
|
|
|
GameDispatcher.Instance.Dispatch(GameMsg.Ad_success, reward);
|
|
|
|
|
SaveData.GetSaveobject().LargeRewardNum++;
|
|
|
|
|
SaveData.saveDataFunc();
|
|
|
|
|
SaveData.GetSaveObject().LargeRewardNum++;
|
|
|
|
|
SaveData.SaveDataFunc();
|
|
|
|
|
DOVirtual.DelayedCall(1.5f, () =>
|
|
|
|
|
{
|
|
|
|
|
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.RewardboxUI_Close);
|
|
|
|
@@ -220,7 +223,7 @@ namespace FlowerPower
|
|
|
|
|
(ui.wheel.GetChild("wheel_") as wheel_).t1.Play(() =>
|
|
|
|
|
{
|
|
|
|
|
rate_idnex++;
|
|
|
|
|
ui.btn_lookad.title = GameHelper.GetValueWithSymbol((decimal)ch_num * boost_array[rate_idnex % boost_array.Length]);
|
|
|
|
|
ui.btn_lookad.title = GameHelper.Get101Str((decimal)cash_num * boost_array[rate_idnex % boost_array.Length]);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
(ui.wheel.GetChild("wheel_") as wheel_).t0.Play(Scroll);
|
|
|
|
@@ -230,4 +233,4 @@ namespace FlowerPower
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|