|
@@ -19,21 +19,22 @@ namespace GFGGame
|
|
private int _type; //决定数据的类型 --等级条件的数据,时间条件的数据
|
|
private int _type; //决定数据的类型 --等级条件的数据,时间条件的数据
|
|
|
|
|
|
private int _pageIndex; //当前页码,需要显示的数据的索引
|
|
private int _pageIndex; //当前页码,需要显示的数据的索引
|
|
-
|
|
|
|
- private List<GameObject> _gameObjectList;
|
|
|
|
|
|
+
|
|
|
|
+ private List<GGraph> _graphList = new List<GGraph>();
|
|
|
|
+ private List<GameObject> _gameObjectList = new List<GameObject>();
|
|
private GameObject _gameObject1;
|
|
private GameObject _gameObject1;
|
|
private GameObject _gameObject2;
|
|
private GameObject _gameObject2;
|
|
private GameObject _gameObject3;
|
|
private GameObject _gameObject3;
|
|
private GameObject _gameObject4;
|
|
private GameObject _gameObject4;
|
|
private GameObject _gameObject5;
|
|
private GameObject _gameObject5;
|
|
|
|
|
|
- private List<GoWrapper> _wrapperList;
|
|
|
|
|
|
+ private List<GoWrapper> _wrapperList = new List<GoWrapper>();
|
|
private GoWrapper _wrapper1;
|
|
private GoWrapper _wrapper1;
|
|
private GoWrapper _wrapper2;
|
|
private GoWrapper _wrapper2;
|
|
private GoWrapper _wrapper3;
|
|
private GoWrapper _wrapper3;
|
|
private GoWrapper _wrapper4;
|
|
private GoWrapper _wrapper4;
|
|
private GoWrapper _wrapper5;
|
|
private GoWrapper _wrapper5;
|
|
-
|
|
|
|
|
|
+
|
|
protected override void OnInit()
|
|
protected override void OnInit()
|
|
{
|
|
{
|
|
base.OnInit();
|
|
base.OnInit();
|
|
@@ -50,7 +51,7 @@ namespace GFGGame
|
|
_ui.m_btnBack.onClick.Add(OnBtnCancelClick);
|
|
_ui.m_btnBack.onClick.Add(OnBtnCancelClick);
|
|
_ui.m_btnBuyPink.target.onClick.Add(OnBtnBuyClick);
|
|
_ui.m_btnBuyPink.target.onClick.Add(OnBtnBuyClick);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
protected override void OnShown()
|
|
protected override void OnShown()
|
|
{
|
|
{
|
|
base.OnShown();
|
|
base.OnShown();
|
|
@@ -84,15 +85,22 @@ namespace GFGGame
|
|
string resPath1 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_pepole");
|
|
string resPath1 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_pepole");
|
|
SceneController.AddObjectToView(null, null, _ui.m_holderPaoBaby, resPath1,
|
|
SceneController.AddObjectToView(null, null, _ui.m_holderPaoBaby, resPath1,
|
|
out _gameObject1, out _wrapper1);
|
|
out _gameObject1, out _wrapper1);
|
|
- string resPath2 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_button");
|
|
|
|
- SceneController.AddObjectToView(null, null, _ui.m_holderBtnBy, resPath2,
|
|
|
|
- out _gameObject2, out _wrapper2);
|
|
|
|
|
|
+
|
|
string resPath3 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_discount_chixu");
|
|
string resPath3 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_discount_chixu");
|
|
SceneController.AddObjectToView(null, null, _ui.m_holderZheKouChiXu, resPath3,
|
|
SceneController.AddObjectToView(null, null, _ui.m_holderZheKouChiXu, resPath3,
|
|
out _gameObject3, out _wrapper3);
|
|
out _gameObject3, out _wrapper3);
|
|
- string resPath4 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_discount_baofa");
|
|
|
|
- SceneController.AddObjectToView(null, null, _ui.m_holderZheKou, resPath4,
|
|
|
|
- out _gameObject4, out _wrapper4);
|
|
|
|
|
|
+
|
|
|
|
+ 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");
|
|
string resPath5 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_star");
|
|
SceneController.AddObjectToView(null, null, _ui.m_holderStar, resPath5,
|
|
SceneController.AddObjectToView(null, null, _ui.m_holderStar, resPath5,
|
|
out _gameObject5, out _wrapper5);
|
|
out _gameObject5, out _wrapper5);
|
|
@@ -263,6 +271,16 @@ namespace GFGGame
|
|
uiItem.m_comRewardIconItem.m_num.text = itemKv[1].ToString();
|
|
uiItem.m_comRewardIconItem.m_num.text = itemKv[1].ToString();
|
|
uiItem.m_comRewardIconItem.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
|
|
uiItem.m_comRewardIconItem.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
|
|
uiItem.m_comRewardIconItem.target.onClick.Add(OnListSelectorItemClick);
|
|
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()
|
|
private void UpViewNone()
|
|
@@ -314,6 +332,30 @@ 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()
|
|
protected override void OnHide()
|
|
{
|
|
{
|
|
SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
|
|
SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
|
|
@@ -321,6 +363,7 @@ namespace GFGGame
|
|
SceneController.DestroyObjectFromView(_gameObject3, _wrapper3);
|
|
SceneController.DestroyObjectFromView(_gameObject3, _wrapper3);
|
|
SceneController.DestroyObjectFromView(_gameObject4, _wrapper4);
|
|
SceneController.DestroyObjectFromView(_gameObject4, _wrapper4);
|
|
SceneController.DestroyObjectFromView(_gameObject5, _wrapper5);
|
|
SceneController.DestroyObjectFromView(_gameObject5, _wrapper5);
|
|
|
|
+ DestroyObjectFromView();
|
|
this.RemoveEventListener();
|
|
this.RemoveEventListener();
|
|
//Dispose();
|
|
//Dispose();
|
|
base.Hide();
|
|
base.Hide();
|
|
@@ -330,7 +373,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
this.Hide();
|
|
this.Hide();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
//弹出物品详细描述框
|
|
//弹出物品详细描述框
|
|
private void OnListSelectorItemClick(EventContext context)
|
|
private void OnListSelectorItemClick(EventContext context)
|
|
{
|
|
{
|