|
@@ -8,6 +8,7 @@ using Assets.Game.HotUpdate.Data;
|
|
|
using System.Collections;
|
|
|
using System;
|
|
|
using GFGGame.Launcher;
|
|
|
+using YooAsset;
|
|
|
|
|
|
namespace GFGGame
|
|
|
{
|
|
@@ -46,6 +47,7 @@ namespace GFGGame
|
|
|
//用于分帧更新红点
|
|
|
private int redPointUpdateFrame = -1;
|
|
|
|
|
|
+ private EffectUI _effectUI1;
|
|
|
public override void Dispose()
|
|
|
{
|
|
|
if (_valueBarController != null)
|
|
@@ -130,6 +132,7 @@ namespace GFGGame
|
|
|
_btnBag.onClick.Add(OnClickBtnBag);
|
|
|
_ui.m_btnGiftBag1.target.onClick.Add(OnClickBtnGiftBag2);
|
|
|
_ui.m_btnGiftBag2.target.onClick.Add(OnClickBtnGiftBag1);
|
|
|
+ _ui.m_btnWeeklyGift.target.onClick.Add(OnClickBtnWeeklyGift);
|
|
|
_ui.m_btnHaiZhiShi.target.onClick.Add(OnClickBtnInstanceZones);
|
|
|
_ui.m_touchMask.onClick.Add(ShowMainUI);
|
|
|
_ui.m_btnShow.target.onClick.Add(HideMainUI);
|
|
@@ -168,6 +171,7 @@ namespace GFGGame
|
|
|
EventAgent.AddEventListener(ConstMessage.AFTER_DATA_INITED, OnAfterDataInited);
|
|
|
EventAgent.AddEventListener(ConstMessage.NEW_YEAR_RED_ENVELOPE_INFO, RefreshBtnNewYearRedEnvelope);
|
|
|
EventAgent.AddEventListener(ConstMessage.ACTIVITY_RED_CHANGE, UpdateActivityRedDot);
|
|
|
+ EventAgent.AddEventListener(ConstMessage.STORY_LEVEL_CHANGE, UpdateNewPlayerReward);
|
|
|
}
|
|
|
|
|
|
protected override void RemoveEventListener()
|
|
@@ -183,6 +187,7 @@ namespace GFGGame
|
|
|
EventAgent.RemoveEventListener(ConstMessage.NEW_YEAR_RED_ENVELOPE_INFO, RefreshBtnNewYearRedEnvelope);
|
|
|
EventAgent.RemoveEventListener(ConstMessage.ACTIVITY_RED_CHANGE, UpdateActivityRedDot);
|
|
|
EventAgent.RemoveEventListener(ConstMessage.RESET_DAILY_DATA, ResetDailyData);
|
|
|
+ EventAgent.RemoveEventListener(ConstMessage.STORY_LEVEL_CHANGE, UpdateNewPlayerReward);
|
|
|
}
|
|
|
|
|
|
protected override void OnShown()
|
|
@@ -204,6 +209,7 @@ namespace GFGGame
|
|
|
SceneController.UpdateMainScene(_sceneObject);
|
|
|
UpdateRoleLvl();
|
|
|
UpdateHead();
|
|
|
+ CardBgRes();
|
|
|
_valueBarController.OnShown();
|
|
|
|
|
|
CheckFunOpen();
|
|
@@ -595,6 +601,10 @@ namespace GFGGame
|
|
|
ViewManager.Show<SevenDayLoginView>();
|
|
|
}
|
|
|
|
|
|
+ private void OnClickBtnWeeklyGift()
|
|
|
+ {
|
|
|
+ ViewManager.Show<WeeklyGiftTipsView>();
|
|
|
+ }
|
|
|
//列表
|
|
|
private void OnClickBtnGiftBag1()
|
|
|
{
|
|
@@ -645,6 +655,22 @@ namespace GFGGame
|
|
|
|
|
|
_ui.m_btnGiftBag2.m_txtTime.text = TimeUtil.GetTimeLeft(TimeInfo.Instance.ServerNow(), list[0].EndTime);
|
|
|
}
|
|
|
+ _ui.m_btnWeeklyGift.m_c1.selectedIndex = 0;
|
|
|
+ if (_ui.m_btnGiftBag2.target.visible)
|
|
|
+ {
|
|
|
+ _ui.m_btnWeeklyGift.target.visible = false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (ActivityDataManager.Instance.GetCurOpenActiveByType(101) == 0)
|
|
|
+ {
|
|
|
+ _ui.m_btnWeeklyGift.target.visible = false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _ui.m_btnWeeklyGift.target.visible = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//圆形样式
|
|
@@ -907,6 +933,37 @@ namespace GFGGame
|
|
|
RoleInfoManager.Instance.UpdateHead(_ui.m_headBar.m_comHead, RoleDataManager.headId,
|
|
|
RoleDataManager.headBorderId);
|
|
|
}
|
|
|
+ private async void CardBgRes()
|
|
|
+ {
|
|
|
+ await RoleInfoSProxy.GetThemeID();
|
|
|
+ if (_effectUI1 != null)
|
|
|
+ {
|
|
|
+ EffectUIPool.Recycle(_effectUI1);
|
|
|
+ _effectUI1 = null;
|
|
|
+ }
|
|
|
+ if(MainDataManager.Instance.CardBgID == 0)
|
|
|
+ {
|
|
|
+ _ui.m_cardBgIcon.m_ComCardImgRes.m_loaCard.url = "";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ItemCfg cardItem = ItemCfgArray.Instance.GetCfg(MainDataManager.Instance.CardBgID);
|
|
|
+ string resName = cardItem.res;
|
|
|
+ string resPath = ResPathUtil.GetCardAnimationPath(resName);
|
|
|
+ Vector2 omCardImgResTargetSize = new Vector2((ViewGlobal.GetRealTopOffset() + _ui.target.height) * CardDataManager.CardResInitWidth / CardDataManager.CardResInitHight, (ViewGlobal.GetRealTopOffset() + _ui.target.height));
|
|
|
+ if (YooAssets.CheckResExist(resPath))
|
|
|
+ {
|
|
|
+ await LoadManager.Instance.CheckResExsitedOrDownload(resPath);
|
|
|
+ _effectUI1 = new EffectUI();
|
|
|
+ _effectUI1.Reset(_ui.m_cardBg, resName, resName, 110, EffectUIType.Card);
|
|
|
+ float offY = GRoot.inst.height / 1000;
|
|
|
+ _ui.m_cardBg.y = _ui.m_cardBg.y + (offY*70);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ _ui.m_cardBgIcon.m_ComCardImgRes.target.size = omCardImgResTargetSize;
|
|
|
+ _ui.m_cardBgIcon.m_ComCardImgRes.m_loaCard.url = ResPathUtil.GetCardPath(resName);
|
|
|
+ }
|
|
|
+ }
|
|
|
/// <summary>
|
|
|
/// 获取当前开启的滚动广告列表
|
|
|
/// </summary>
|
|
@@ -1212,6 +1269,10 @@ namespace GFGGame
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ private void UpdateNewPlayerReward(EventContext context)
|
|
|
+ {
|
|
|
+ ActivitySProxy.ReqGetNewPlayerBonusStatus().Coroutine();
|
|
|
+ }
|
|
|
|
|
|
private void CheckProbabilityUp()
|
|
|
{
|