|
|
|
@@ -3,16 +3,15 @@ using UnityEngine;
|
|
|
|
|
// using FGUI.G002_main;
|
|
|
|
|
using Spine.Unity;
|
|
|
|
|
using DG.Tweening;
|
|
|
|
|
using FGUI.P06_Hall;
|
|
|
|
|
using FGUI.P01_Common;
|
|
|
|
|
using FGUI.ZM_Lobby_03;
|
|
|
|
|
|
|
|
|
|
namespace FlowerPower
|
|
|
|
|
namespace LoveLegend
|
|
|
|
|
{
|
|
|
|
|
public class FirstRewardUI : BaseUI
|
|
|
|
|
{
|
|
|
|
|
private FirstRewardUICtrl ctrl;
|
|
|
|
|
private FirstRewardModel model;
|
|
|
|
|
private FGUI.P06_Hall.com_first_award ui;
|
|
|
|
|
private FGUI.ZM_Lobby_03.com_first_award ui;
|
|
|
|
|
private Action closeCallback;
|
|
|
|
|
private Action open_sign;
|
|
|
|
|
private bool is_get = false;
|
|
|
|
@@ -24,7 +23,7 @@ namespace FlowerPower
|
|
|
|
|
|
|
|
|
|
protected override void SetUIInfo(UIInfo uiInfo)
|
|
|
|
|
{
|
|
|
|
|
uiInfo.packageName = "P06_Hall";
|
|
|
|
|
uiInfo.packageName = "ZM_Lobby_03";
|
|
|
|
|
uiInfo.assetName = "com_first_award";
|
|
|
|
|
uiInfo.layerType = UILayerType.Popup;
|
|
|
|
|
uiInfo.isNeedOpenAnim = false;
|
|
|
|
@@ -46,14 +45,14 @@ namespace FlowerPower
|
|
|
|
|
|
|
|
|
|
protected override void OnBind()
|
|
|
|
|
{
|
|
|
|
|
ui = baseUI as FGUI.P06_Hall.com_first_award;
|
|
|
|
|
ui = baseUI as FGUI.ZM_Lobby_03.com_first_award;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnOpenBefore(object args)
|
|
|
|
|
{
|
|
|
|
|
if (Screen.safeArea.y != 0)
|
|
|
|
|
{//刘海屏
|
|
|
|
|
ui.money.y += Screen.safeArea.y;
|
|
|
|
|
ui.com_gold.y += Screen.safeArea.y;
|
|
|
|
|
}
|
|
|
|
|
InitView();
|
|
|
|
|
}
|
|
|
|
@@ -86,13 +85,9 @@ namespace FlowerPower
|
|
|
|
|
//初始化页面逻辑
|
|
|
|
|
private void InitView()
|
|
|
|
|
{
|
|
|
|
|
// ui.money.GetChild("text_gold").text = $"{PreferencesMgr.Instance.Currency101:N0}";
|
|
|
|
|
ui.money.GetChild("btn_ch").visible = false;
|
|
|
|
|
com_money money = ui.money as com_money;
|
|
|
|
|
money.btn_ch.visible = false;
|
|
|
|
|
money.number_text.text = GameHelper.Get102Str();
|
|
|
|
|
ui.com_gold.GetChild("text_gold").text = $"{DataMgr.Coin.Value:N0}";
|
|
|
|
|
|
|
|
|
|
ui.text_num.text = GameHelper.Get102Str(ConfigSystem.GetConfig<CommonModel>().InitialNum);
|
|
|
|
|
ui.text_num.text = GameHelper.Get101Str(ConfigSystem.GetCommonConf().InitialNum);
|
|
|
|
|
var sk = FXManager.Instance.SetFx<SkeletonAnimation>(ui.spine_parent, Fx_Type.fx_first_reward, ref closeCallback);
|
|
|
|
|
sk.state.SetAnimation(0, "newbie_reward_an01", false);
|
|
|
|
|
sk.state.Complete += (a) =>
|
|
|
|
@@ -116,23 +111,22 @@ namespace FlowerPower
|
|
|
|
|
private void GetReward()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
com_money money = ui.money as com_money;
|
|
|
|
|
|
|
|
|
|
if (is_get) return;
|
|
|
|
|
is_get = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var start = GameHelper.GetUICenterPosition(ui.img_money);
|
|
|
|
|
var end = GameHelper.GetUICenterPosition(ui.money.GetChild("icon"));
|
|
|
|
|
var end = GameHelper.GetUICenterPosition(ui.com_gold.GetChild("icon"));
|
|
|
|
|
|
|
|
|
|
int awardNum = ConfigSystem.GetConfig<CommonModel>().InitialNum;
|
|
|
|
|
int awardNum = ConfigSystem.GetCommonConf().InitialNum;
|
|
|
|
|
|
|
|
|
|
var rewardData = new RewardData();
|
|
|
|
|
|
|
|
|
|
var rewardSingleData = new RewardSingleData(102, awardNum, RewardOrigin.AdTask)
|
|
|
|
|
var floor = Math.Floor((decimal)awardNum);
|
|
|
|
|
var rewardSingleData = new RewardSingleData(101, floor, RewardOrigin.AdTask)
|
|
|
|
|
{
|
|
|
|
|
startPosition = start,
|
|
|
|
|
endPosition = new Vector2(end.x - 150, end.y - 136)
|
|
|
|
|
endPosition = new Vector2(end.x, end.y)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
rewardData.AddReward(rewardSingleData);
|
|
|
|
@@ -141,11 +135,10 @@ namespace FlowerPower
|
|
|
|
|
{
|
|
|
|
|
if (success)
|
|
|
|
|
{
|
|
|
|
|
var startNum = PreferencesMgr.Instance.Currency102 - awardNum;
|
|
|
|
|
DOVirtual.Float((float)startNum, (float)PreferencesMgr.Instance.Currency102, 1,
|
|
|
|
|
value => { money.number_text.text = GameHelper.Get102Str((decimal)value); });
|
|
|
|
|
SaveData.GetSaveobject().isGetFirstGift = 1;
|
|
|
|
|
GameDispatcher.Instance.Dispatch(GameMsg.UpdateCurrency102);
|
|
|
|
|
ui.com_gold.GetChild("text_gold").text = $"{awardNum:N0}";
|
|
|
|
|
|
|
|
|
|
DataMgr.GetFirstReaward.Value = true;
|
|
|
|
|
DataMgr.GetFirstReaward.Save();
|
|
|
|
|
DOVirtual.DelayedCall(1.5f, () =>
|
|
|
|
|
{
|
|
|
|
|
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.FirstRewardUI_Close);
|
|
|
|
@@ -155,4 +148,4 @@ namespace FlowerPower
|
|
|
|
|
GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|