|
@@ -45,13 +45,16 @@ namespace GFGGame
|
|
|
|
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
|
|
+ base.Dispose();
|
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
|
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject2, _wrapper2);
|
|
|
|
+ SceneController.DestroyObjectFromView(_gameObject3, _wrapper3);
|
|
|
|
+ DestroyObjectFromView();
|
|
if (_ui != null)
|
|
if (_ui != null)
|
|
{
|
|
{
|
|
_ui.Dispose();
|
|
_ui.Dispose();
|
|
_ui = null;
|
|
_ui = null;
|
|
}
|
|
}
|
|
-
|
|
|
|
- base.Dispose();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnShown()
|
|
protected override void OnShown()
|
|
@@ -83,14 +86,25 @@ namespace GFGGame
|
|
private void AddEffect()
|
|
private void AddEffect()
|
|
{
|
|
{
|
|
string resPath1 = ResPathUtil.GetViewEffectPath("ui_Activity", "Prefer_person");
|
|
string resPath1 = ResPathUtil.GetViewEffectPath("ui_Activity", "Prefer_person");
|
|
- SceneController.AddObjectToView(null, null, _ui.m_holderBaby, resPath1,
|
|
|
|
- out _gameObject1, out _wrapper1);
|
|
|
|
- string resPath2 = ResPathUtil.GetViewEffectPath("ui_Activity", "Prefer_chixu_tx");
|
|
|
|
- SceneController.AddObjectToView(null, null, _ui.m_holderChiXuTx, resPath2,
|
|
|
|
- out _gameObject2, out _wrapper2);
|
|
|
|
- string resPath3 = ResPathUtil.GetViewEffectPath("ui_Activity", "Prefer_one_tx");
|
|
|
|
- SceneController.AddObjectToView(null, null, _ui.m_holderOneTx, resPath3,
|
|
|
|
- out _gameObject3, out _wrapper3);
|
|
|
|
|
|
+ if (_gameObject1 == null)
|
|
|
|
+ {
|
|
|
|
+ SceneController.AddObjectToView(null, null, _ui.m_holderBaby, resPath1,
|
|
|
|
+ out _gameObject1, out _wrapper1);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (_gameObject2 == null)
|
|
|
|
+ {
|
|
|
|
+ string resPath2 = ResPathUtil.GetViewEffectPath("ui_Activity", "Prefer_chixu_tx");
|
|
|
|
+ SceneController.AddObjectToView(null, null, _ui.m_holderChiXuTx, resPath2,
|
|
|
|
+ out _gameObject2, out _wrapper2);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (_gameObject3 == null)
|
|
|
|
+ {
|
|
|
|
+ string resPath3 = ResPathUtil.GetViewEffectPath("ui_Activity", "Prefer_one_tx");
|
|
|
|
+ SceneController.AddObjectToView(null, null, _ui.m_holderOneTx, resPath3,
|
|
|
|
+ out _gameObject3, out _wrapper3);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
public void UpTime()
|
|
public void UpTime()
|
|
@@ -189,7 +203,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
mTxtUrc = $"永久限购{remainBuyNum}/{shopCfg.maxBuyNum}";
|
|
mTxtUrc = $"永久限购{remainBuyNum}/{shopCfg.maxBuyNum}";
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
uiItem.m_btnBuy.m_txtOldPrice.text = shopCfg.originalPrice.ToString();
|
|
uiItem.m_btnBuy.m_txtOldPrice.text = shopCfg.originalPrice.ToString();
|
|
if (shopCfg.costType == CostType.ITEM)
|
|
if (shopCfg.costType == CostType.ITEM)
|
|
{
|
|
{
|
|
@@ -219,7 +233,7 @@ namespace GFGGame
|
|
uiItem.m_btnBuy.m_txtNewPrice.x = 125;
|
|
uiItem.m_btnBuy.m_txtNewPrice.x = 125;
|
|
uiItem.m_btnBuy.m_txtOldPrice.x = 30;
|
|
uiItem.m_btnBuy.m_txtOldPrice.x = 30;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if (remainBuyNum == 0)
|
|
if (remainBuyNum == 0)
|
|
{
|
|
{
|
|
//已售完
|
|
//已售完
|
|
@@ -312,7 +326,7 @@ namespace GFGGame
|
|
uiItemChild.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfgChild);
|
|
uiItemChild.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfgChild);
|
|
uiItemChild.m_num.text = itemArr[1].ToString();
|
|
uiItemChild.m_num.text = itemArr[1].ToString();
|
|
uiItemChild.target.data = itemCfgChild;
|
|
uiItemChild.target.data = itemCfgChild;
|
|
-
|
|
|
|
|
|
+
|
|
if (!_graphList.Contains(uiItemChild.m_holderItem))
|
|
if (!_graphList.Contains(uiItemChild.m_holderItem))
|
|
{
|
|
{
|
|
string resPath = ResPathUtil.GetViewEffectPath("ui_Activity", "Prefer_kuang");
|
|
string resPath = ResPathUtil.GetViewEffectPath("ui_Activity", "Prefer_kuang");
|
|
@@ -322,7 +336,7 @@ namespace GFGGame
|
|
_gameObjectList.Add(gameObject);
|
|
_gameObjectList.Add(gameObject);
|
|
_wrapperList.Add(wrapper);
|
|
_wrapperList.Add(wrapper);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
uiItemChild.m_t0.Play();
|
|
uiItemChild.m_t0.Play();
|
|
|
|
|
|
UI_ComRewardIconItem.ProxyEnd();
|
|
UI_ComRewardIconItem.ProxyEnd();
|
|
@@ -385,7 +399,7 @@ namespace GFGGame
|
|
ViewManager.Show<ItemExchangeView>(cfg.id);
|
|
ViewManager.Show<ItemExchangeView>(cfg.id);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
private void DestroyObjectFromView()
|
|
private void DestroyObjectFromView()
|
|
{
|
|
{
|
|
foreach (var itemGameObject in _gameObjectList)
|
|
foreach (var itemGameObject in _gameObjectList)
|
|
@@ -395,7 +409,7 @@ namespace GFGGame
|
|
GameObject.DestroyImmediate(itemGameObject);
|
|
GameObject.DestroyImmediate(itemGameObject);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
_gameObjectList.Clear();
|
|
_gameObjectList.Clear();
|
|
|
|
|
|
foreach (var itemWrapper in _wrapperList)
|
|
foreach (var itemWrapper in _wrapperList)
|
|
@@ -412,12 +426,7 @@ namespace GFGGame
|
|
|
|
|
|
protected override void OnHide()
|
|
protected override void OnHide()
|
|
{
|
|
{
|
|
- SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
|
|
|
|
- SceneController.DestroyObjectFromView(_gameObject2, _wrapper2);
|
|
|
|
- SceneController.DestroyObjectFromView(_gameObject3, _wrapper3);
|
|
|
|
- DestroyObjectFromView();
|
|
|
|
this.RemoveEventListener();
|
|
this.RemoveEventListener();
|
|
- // Dispose();
|
|
|
|
base.Hide();
|
|
base.Hide();
|
|
}
|
|
}
|
|
|
|
|