|
@@ -15,8 +15,8 @@ namespace GFGGame
|
|
|
private ValueBarController _valueBarController;
|
|
|
private Dictionary<int, LuckyBoxController> _luckyBoxCtrl = new Dictionary<int, LuckyBoxController>();
|
|
|
|
|
|
- private EffectUI _effectUI1;
|
|
|
- private EffectUI _effectUI2;
|
|
|
+ private Dictionary<string, EffectUI> _effectUIDic = new Dictionary<string, EffectUI>();
|
|
|
+
|
|
|
private DressUpObjUI _dressUpObjUIXiHe;
|
|
|
|
|
|
private DressUpObjUI _dressUpObjUIChangXi;
|
|
@@ -28,8 +28,14 @@ namespace GFGGame
|
|
|
|
|
|
public override void Dispose()
|
|
|
{
|
|
|
- EffectUIPool.Recycle(_effectUI1);
|
|
|
- _effectUI1 = null;
|
|
|
+
|
|
|
+ // Clear Effect
|
|
|
+ foreach (var v in _effectUIDic)
|
|
|
+ {
|
|
|
+ EffectUIPool.Recycle(v.Value);
|
|
|
+ }
|
|
|
+
|
|
|
+ _effectUIDic.Clear();
|
|
|
|
|
|
if (_valueBarController != null)
|
|
|
{
|
|
@@ -271,17 +277,30 @@ namespace GFGGame
|
|
|
|
|
|
_luckyBoxCtrl[LuckyBoxDataManager.Instance.currentBoxId].OnShown(LuckyBoxDataManager.Instance.currentBoxId);
|
|
|
|
|
|
- comBox.m_comLuckBoxBtn.m_imgSpecial.visible = boxId != LuckyBoxDataManager.BOX_ID_3;
|
|
|
+ if(boxId != LuckyBoxDataManager.BOX_ID_3)
|
|
|
+ {
|
|
|
+ if(!_effectUIDic.ContainsKey("Button_Text_DianCang" + boxId))
|
|
|
+ {
|
|
|
+ _effectUIDic.Add("Button_Text_DianCang" + boxId, EffectUIPool.CreateEffectUI(comBox.m_comLuckBoxBtn.m_Special_eff, "ui_LuckyBox", "Button_Text_DianCang"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if (_effectUIDic.ContainsKey("Button_Text_DianCang" + boxId))
|
|
|
+ {
|
|
|
+ EffectUIPool.Recycle(_effectUIDic["Button_Text_DianCang" + boxId]);
|
|
|
+ _effectUIDic.Remove("Button_Text_DianCang" + boxId);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ //comBox.m_comLuckBoxBtn.m_imgSpecial.visible = boxId != LuckyBoxDataManager.BOX_ID_3;
|
|
|
+
|
|
|
//GGraph holder = comBox.m_comLuckBoxBtn.m_btnBuyTen.GetChild("holder").asGraph;
|
|
|
//holder.visible = boxId != LuckyBoxDataManager.BOX_ID_3;
|
|
|
comBox.m_comLuckBoxBtn.m_holder.visible = boxId != LuckyBoxDataManager.BOX_ID_3;
|
|
|
|
|
|
- if (_effectUI2 != null) {
|
|
|
- EffectUIPool.Recycle(_effectUI2);
|
|
|
- _effectUI2 = null;
|
|
|
- }
|
|
|
+
|
|
|
//_effectUI1 = EffectUIPool.CreateEffectUI(holder, "ui_LuckyBox", "Button_Glow");
|
|
|
- _effectUI2 = EffectUIPool.CreateEffectUI(comBox.m_comLuckBoxBtn.m_holder, "ui_LuckyBox", "but_text_dc");
|
|
|
|
|
|
comBox.m_comLuckBoxBtn.m_comCostOne.m_txtCost.text = cfg.costNum.ToString();
|
|
|
comBox.m_comLuckBoxBtn.m_comCostOne.m_loaCost.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(cfg.costID).res);
|
|
@@ -297,6 +316,7 @@ namespace GFGGame
|
|
|
if (comBox.m_comLuckBoxBtn.m_btnBuyTen.data == null)
|
|
|
{
|
|
|
comBox.m_comLuckBoxBtn.m_btnBuyTen.onClick.Add(OnClickBtnBuyTen);
|
|
|
+ _effectUIDic.Add("Button_public" + boxId, EffectUIPool.CreateEffectUI(comBox.m_comLuckBoxBtn.m_btnBuyTen_eff, "ui_LuckyBox", "Button_public"));
|
|
|
}
|
|
|
comBox.m_comLuckBoxBtn.m_btnBuyTen.data = boxId;
|
|
|
|
|
@@ -572,9 +592,6 @@ namespace GFGGame
|
|
|
{
|
|
|
base.OnHide();
|
|
|
|
|
|
- EffectUIPool.Recycle(_effectUI2);
|
|
|
- _effectUI2 = null;
|
|
|
-
|
|
|
_valueBarController.OnHide();
|
|
|
foreach (int key in _luckyBoxCtrl.Keys)
|
|
|
{
|