|
@@ -20,6 +20,21 @@ namespace GFGGame
|
|
|
|
|
|
private int _pageIndex; //当前页码,需要显示的数据的索引
|
|
|
|
|
|
+ private List<GGraph> _graphList = new List<GGraph>();
|
|
|
+ private List<GameObject> _gameObjectList = new List<GameObject>();
|
|
|
+ private GameObject _gameObject1;
|
|
|
+ private GameObject _gameObject2;
|
|
|
+ private GameObject _gameObject3;
|
|
|
+ private GameObject _gameObject4;
|
|
|
+ private GameObject _gameObject5;
|
|
|
+
|
|
|
+ private List<GoWrapper> _wrapperList = new List<GoWrapper>();
|
|
|
+ private GoWrapper _wrapper1;
|
|
|
+ private GoWrapper _wrapper2;
|
|
|
+ private GoWrapper _wrapper3;
|
|
|
+ private GoWrapper _wrapper4;
|
|
|
+ private GoWrapper _wrapper5;
|
|
|
+
|
|
|
protected override void OnInit()
|
|
|
{
|
|
|
base.OnInit();
|
|
@@ -36,12 +51,13 @@ namespace GFGGame
|
|
|
_ui.m_btnBack.onClick.Add(OnBtnCancelClick);
|
|
|
_ui.m_btnBuyPink.target.onClick.Add(OnBtnBuyClick);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
protected override void OnShown()
|
|
|
{
|
|
|
base.OnShown();
|
|
|
_type = (int)(this.viewData as object[])[0]; //ConstActivityType
|
|
|
AddEffect();
|
|
|
+ _ui.m_t3.Play();
|
|
|
LimitedTimeGiftBoxDataManager.Instance.UpLtgGbItemData4();
|
|
|
LimitedTimeGiftBoxDataManager.Instance.UpLtgGbItemData5();
|
|
|
InitPageInex();
|
|
@@ -66,6 +82,28 @@ namespace GFGGame
|
|
|
|
|
|
private void AddEffect()
|
|
|
{
|
|
|
+ string resPath1 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_pepole");
|
|
|
+ SceneController.AddObjectToView(null, null, _ui.m_holderPaoBaby, resPath1,
|
|
|
+ out _gameObject1, out _wrapper1);
|
|
|
+
|
|
|
+ string resPath3 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_discount_chixu");
|
|
|
+ SceneController.AddObjectToView(null, null, _ui.m_holderZheKouChiXu, resPath3,
|
|
|
+ out _gameObject3, out _wrapper3);
|
|
|
+
|
|
|
+ Timers.inst.Add(0.8f, 1, (obj) =>
|
|
|
+ {
|
|
|
+ string resPath4 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_discount_baofa");
|
|
|
+ SceneController.AddObjectToView(null, null, _ui.m_holderZheKou, resPath4,
|
|
|
+ out _gameObject4, out _wrapper4);
|
|
|
+
|
|
|
+ string resPath2 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_button");
|
|
|
+ SceneController.AddObjectToView(null, null, _ui.m_holderBtnBy, resPath2,
|
|
|
+ out _gameObject2, out _wrapper2);
|
|
|
+ }
|
|
|
+ );
|
|
|
+ string resPath5 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_star");
|
|
|
+ SceneController.AddObjectToView(null, null, _ui.m_holderStar, resPath5,
|
|
|
+ out _gameObject5, out _wrapper5);
|
|
|
}
|
|
|
|
|
|
//实例化索引
|
|
@@ -233,6 +271,16 @@ namespace GFGGame
|
|
|
uiItem.m_comRewardIconItem.m_num.text = itemKv[1].ToString();
|
|
|
uiItem.m_comRewardIconItem.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
|
|
|
uiItem.m_comRewardIconItem.target.onClick.Add(OnListSelectorItemClick);
|
|
|
+
|
|
|
+ if (!_graphList.Contains(uiItem.m_holderItem))
|
|
|
+ {
|
|
|
+ string resPath = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_kuang");
|
|
|
+ SceneController.AddObjectToView(null, null, uiItem.m_holderItem, resPath, out var gameObject,
|
|
|
+ out var wrapper);
|
|
|
+ _graphList.Add(uiItem.m_holderItem);
|
|
|
+ _gameObjectList.Add(gameObject);
|
|
|
+ _wrapperList.Add(wrapper);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private void UpViewNone()
|
|
@@ -284,8 +332,38 @@ namespace GFGGame
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void DestroyObjectFromView()
|
|
|
+ {
|
|
|
+ foreach (var itemGameObject in _gameObjectList)
|
|
|
+ {
|
|
|
+ if (itemGameObject != null)
|
|
|
+ {
|
|
|
+ GameObject.DestroyImmediate(itemGameObject);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ _gameObjectList.Clear();
|
|
|
+
|
|
|
+ foreach (var itemWrapper in _wrapperList)
|
|
|
+ {
|
|
|
+ if (itemWrapper != null)
|
|
|
+ {
|
|
|
+ itemWrapper.Dispose();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ _wrapperList.Clear();
|
|
|
+ _graphList.Clear();
|
|
|
+ }
|
|
|
+
|
|
|
protected override void OnHide()
|
|
|
{
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject2, _wrapper2);
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject3, _wrapper3);
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject4, _wrapper4);
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject5, _wrapper5);
|
|
|
+ DestroyObjectFromView();
|
|
|
this.RemoveEventListener();
|
|
|
//Dispose();
|
|
|
base.Hide();
|
|
@@ -295,7 +373,7 @@ namespace GFGGame
|
|
|
{
|
|
|
this.Hide();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//弹出物品详细描述框
|
|
|
private void OnListSelectorItemClick(EventContext context)
|
|
|
{
|