|
@@ -4,15 +4,23 @@ using UI.NewYearRedEnvelope;
|
|
|
using UI.CommonGame;
|
|
|
using UnityEngine;
|
|
|
using System;
|
|
|
+using System.Collections.Generic;
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
|
public class NewYearRedEnvelopeView : BaseWindow
|
|
|
{
|
|
|
private UI_NewYearRedEnvelopeUI _ui;
|
|
|
+ private List<EffectUI> _effectUIList = new List<EffectUI>();
|
|
|
|
|
|
public override void Dispose()
|
|
|
{
|
|
|
+ for (int i = 0; i < _effectUIList.Count; i++)
|
|
|
+ {
|
|
|
+ EffectUIPool.Recycle(_effectUIList[i]);
|
|
|
+ }
|
|
|
+ _effectUIList.Clear();
|
|
|
+
|
|
|
if (_ui != null)
|
|
|
{
|
|
|
_ui.Dispose();
|
|
@@ -38,20 +46,31 @@ namespace GFGGame
|
|
|
protected override void OnShown()
|
|
|
{
|
|
|
base.OnShown();
|
|
|
- ET.Log.Debug("댔丹꿎桿=====댔역븐관썹충==========="+ NewYearRedEnvelopeDataManager.Status);
|
|
|
- if (NewYearRedEnvelopeDataManager.Status == RedPacketStatus.None) {
|
|
|
+ if (NewYearRedEnvelopeDataManager.Status == RedPacketStatus.None)
|
|
|
+ {
|
|
|
_ui.m_openType.selectedIndex = 0;
|
|
|
_ui.m_titleImgType.selectedIndex = 0;
|
|
|
RedDotController.Instance.SetComRedDot(_ui.m_btnOpen, true, "", -50, 100);
|
|
|
+ RefreshTime();
|
|
|
}
|
|
|
- else {
|
|
|
- ET.Log.Debug("댔丹꿎桿=====댔역븐관썹충=====66======");
|
|
|
+ else
|
|
|
+ {
|
|
|
RefreshOpenView();
|
|
|
RefreshViewInfo();
|
|
|
}
|
|
|
+ AddEffect();
|
|
|
Timers.inst.Add(1, 0, UpdateTime);
|
|
|
}
|
|
|
|
|
|
+ private void AddEffect()
|
|
|
+ {
|
|
|
+ _effectUIList.Add(EffectUIPool.CreateEffectUI(_ui.m_holderTitle, "ui_Activity", "RedPack_Top_Quad"));
|
|
|
+ _effectUIList.Add(EffectUIPool.CreateEffectUI(_ui.m_holderAFu, "ui_Activity", "RedPack_AF_Anmation"));
|
|
|
+ _effectUIList.Add(EffectUIPool.CreateEffectUI(_ui.m_holderOpenBtn, "ui_Activity", "RedPack_ONE_cirle"));
|
|
|
+ _effectUIList.Add(EffectUIPool.CreateEffectUI(_ui.m_holderdoubao1, "ui_Activity", "RedPack_doubao_Loop"));
|
|
|
+ _effectUIList.Add(EffectUIPool.CreateEffectUI(_ui.m_holderdoubao2, "ui_Activity", "RedPack_doubao_Loop_R"));
|
|
|
+ }
|
|
|
+
|
|
|
protected override void AddEventListener()
|
|
|
{
|
|
|
base.AddEventListener();
|
|
@@ -66,13 +85,12 @@ namespace GFGGame
|
|
|
|
|
|
private void RefreshViewInfo()
|
|
|
{
|
|
|
- ET.Log.Debug("댔丹꿎桿=====댔역븐관썹충======8888=====" + NewYearRedEnvelopeDataManager.Status);
|
|
|
_ui.m_btnDoubleGet.target.visible = NewYearRedEnvelopeDataManager.Status != RedPacketStatus.Double;
|
|
|
}
|
|
|
|
|
|
private void RefreshOpenView()
|
|
|
{
|
|
|
- _ui.m_openType.selectedIndex = 1;
|
|
|
+ _ui.m_openType.selectedIndex = 2;
|
|
|
var titleIndex = PlayerPrefs.GetString("NewYearRedEnvelopeRamdomInt");
|
|
|
_ui.m_titleImgType.selectedIndex = Convert.ToInt32(titleIndex);
|
|
|
UI_ComItem item = UI_ComItem.Proxy(_ui.m_itemReward);
|
|
@@ -88,6 +106,11 @@ namespace GFGGame
|
|
|
|
|
|
private void UpdateTime(object param)
|
|
|
{
|
|
|
+ RefreshTime();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void RefreshTime()
|
|
|
+ {
|
|
|
int actLimitId = ActivityDataManager.Instance.GetCurOpenActiveByType(ActivityType.NewYearRedPacket);
|
|
|
ActivityOpenCfg activityOpenCfg = ActivityOpenCfgArray.Instance.GetCfg(actLimitId);
|
|
|
long time = TimeUtil.DateTimeToTimestamp(activityOpenCfg.endTime) - TimeHelper.ServerNow();
|
|
@@ -116,6 +139,7 @@ namespace GFGGame
|
|
|
|
|
|
private void OnClickBtnOpen(EventContext context)
|
|
|
{
|
|
|
+ _ui.m_imgTitle.visible = false;
|
|
|
ReqLeagueList();
|
|
|
}
|
|
|
|
|
@@ -125,14 +149,23 @@ namespace GFGGame
|
|
|
bool result = await NewYearRedEnvelopeSProxy.ReqOpenRedPacket(actRedPacketId);
|
|
|
if (result)
|
|
|
{
|
|
|
- RefreshOpenView();
|
|
|
+ _ui.m_openType.selectedIndex = 1;
|
|
|
+ _effectUIList.Add(EffectUIPool.CreateEffectUI(_ui.m_holderAllBg, "ui_Activity", "RedPack_ALL_tx"));
|
|
|
+ Timers.inst.Add(0.7f, 0, UpdateOpenTime);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void UpdateOpenTime(object param)
|
|
|
+ {
|
|
|
+ _ui.m_imgTitle.visible = true;
|
|
|
+ RefreshOpenView();
|
|
|
+ }
|
|
|
+
|
|
|
protected override void OnHide()
|
|
|
{
|
|
|
base.OnHide();
|
|
|
Timers.inst.Remove(UpdateTime);
|
|
|
+ Timers.inst.Remove(UpdateOpenTime);
|
|
|
}
|
|
|
}
|
|
|
}
|