|
@@ -10,19 +10,15 @@ namespace GFGGame
|
|
|
{
|
|
|
private UI_LuckBoxBonusShowUI _ui;
|
|
|
private List<ItemData> _rewardList = new List<ItemData>();
|
|
|
- // private List<GameObject> _gameobjects = new List<GameObject>();
|
|
|
- //private Dictionary<int, Dictionary<int, EffectUI>> _effList = new Dictionary<int, Dictionary<int, EffectUI>>();
|
|
|
- private List<EffectUI> _effList = new List<EffectUI>();
|
|
|
+ private Dictionary<int , Dictionary<int, EffectUI>> _effListTen = new Dictionary<int, Dictionary<int, EffectUI>>();
|
|
|
+ private Dictionary<int, EffectUI> _effList = new Dictionary<int, EffectUI>();
|
|
|
|
|
|
private EffectUI _effectUI1;
|
|
|
private EffectUI _effectUI2;
|
|
|
private EffectUI _effectUI3;
|
|
|
- private EffectUI _effectUI4;
|
|
|
|
|
|
- private int _effectIndex = 0;
|
|
|
public override void Dispose()
|
|
|
{
|
|
|
- base.Dispose();
|
|
|
EffectUIPool.Recycle(_effectUI1);
|
|
|
_effectUI1 = null;
|
|
|
EffectUIPool.Recycle(_effectUI2);
|
|
@@ -30,17 +26,37 @@ namespace GFGGame
|
|
|
EffectUIPool.Recycle(_effectUI3);
|
|
|
_effectUI3 = null;
|
|
|
|
|
|
- // for (int i = 0; i < _gameobjects.Count; i++)
|
|
|
- // {
|
|
|
- // SceneController.DestroyObjectFromView(_gameobjects[i], _wrappers[i]);
|
|
|
+ for (int key = 0; key < _effListTen.Count; key++) {
|
|
|
+ if (_effListTen.ContainsKey(key))
|
|
|
+ {
|
|
|
+ for (int key1 = 0; key1 < _effListTen[key].Count; key1++)
|
|
|
+ {
|
|
|
+ if (_effListTen[key].ContainsKey(key1))
|
|
|
+ {
|
|
|
+ EffectUIPool.Recycle(_effListTen[key][key1]);
|
|
|
+ _effListTen[key][key1] = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ _effListTen.Clear();
|
|
|
|
|
|
- // }
|
|
|
+ for (int key = 0; key < _effList.Count; key++)
|
|
|
+ {
|
|
|
+ if (_effList.ContainsKey(key))
|
|
|
+ {
|
|
|
+ EffectUIPool.Recycle(_effList[key]);
|
|
|
+ _effList[key] = null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ _effList.Clear();
|
|
|
|
|
|
if (_ui != null)
|
|
|
{
|
|
|
_ui.Dispose();
|
|
|
_ui = null;
|
|
|
}
|
|
|
+ base.Dispose();
|
|
|
}
|
|
|
|
|
|
protected override void OnInit()
|
|
@@ -66,7 +82,6 @@ namespace GFGGame
|
|
|
{
|
|
|
base.OnShown();
|
|
|
_rewardList.AddRange(this.viewData as List<ItemData>);
|
|
|
- _effectIndex = 0;
|
|
|
if (_rewardList.Count == 1)
|
|
|
{
|
|
|
_ui.m_c1.selectedIndex = 0;
|
|
@@ -84,18 +99,9 @@ namespace GFGGame
|
|
|
|
|
|
protected override void OnHide()
|
|
|
{
|
|
|
- for (int key = 0; key < _effList.Count; key++)
|
|
|
- {
|
|
|
- EffectUIPool.Recycle(_effList[key]);
|
|
|
- _effList[key] = null;
|
|
|
- }
|
|
|
- _effList.Clear();
|
|
|
-
|
|
|
- EffectUIPool.Recycle(_effectUI4);
|
|
|
- _effectUI4 = null;
|
|
|
+ _rewardList.Clear();
|
|
|
|
|
|
base.OnHide();
|
|
|
- _rewardList.Clear();
|
|
|
GetSuitItemController.TryShow(0);
|
|
|
}
|
|
|
|
|
@@ -110,19 +116,46 @@ namespace GFGGame
|
|
|
item.m_comIcon.m_icon.url = ResPathUtil.GetIconPath(itemCfg);
|
|
|
RarityIconController.UpdateRarityIcon(item.m_comIcon.m_rarity, itemData.id, false);
|
|
|
|
|
|
- string resPath = itemCfg.rarity == ConstDressRarity.Rarity_TIANYI ? "CK_all_01" : "CK_all_02";
|
|
|
+ item.m_comIcon.m_holder.visible = false;
|
|
|
+ item.m_comIcon.m_holder1.visible = false;
|
|
|
|
|
|
- if (countType == 10 && itemCfg.rarity > 2 )//&& (!_effList.ContainsKey(itemCfg.rarity) || !_effList[itemCfg.rarity].ContainsKey(index)))
|
|
|
- {
|
|
|
- GGraph holder = itemCfg.rarity == 3 ? item.m_comIcon.m_holder : item.m_comIcon.m_holder1;
|
|
|
- EffectUI _effectUI = EffectUIPool.CreateEffectUI(holder, "ui_LuckyBox", resPath);
|
|
|
- _effList.Add(_effectUI);
|
|
|
- }
|
|
|
- if (countType == 1 && itemCfg.rarity > 2 && _effectUI4 == null)
|
|
|
- {
|
|
|
+ if (itemCfg.rarity > 2) {
|
|
|
+ string resPath = itemCfg.rarity == ConstDressRarity.Rarity_TIANYI ? "CK_all_01" : "CK_all_02";
|
|
|
GGraph holder = itemCfg.rarity == 3 ? item.m_comIcon.m_holder : item.m_comIcon.m_holder1;
|
|
|
- _effectUI4 = EffectUIPool.CreateEffectUI(holder, "ui_LuckyBox", resPath);
|
|
|
+ holder.visible = true;
|
|
|
+ if (countType == 10 && (!_effListTen.ContainsKey(index) ||
|
|
|
+ ((itemCfg.rarity == 3 && !_effListTen[index].ContainsKey(0)) || (itemCfg.rarity == 4 && !_effListTen[index].ContainsKey(1)))))
|
|
|
+ {
|
|
|
+ EffectUI _effectUI = EffectUIPool.CreateEffectUI(holder, "ui_LuckyBox", resPath);
|
|
|
+
|
|
|
+ if (!_effListTen.ContainsKey(index))
|
|
|
+ {
|
|
|
+ Dictionary<int, EffectUI> effectList = new Dictionary<int, EffectUI>();
|
|
|
+ if (itemCfg.rarity == 3)
|
|
|
+ effectList.Add(0, _effectUI);
|
|
|
+ else if (itemCfg.rarity == 4)
|
|
|
+ effectList.Add(1, _effectUI);
|
|
|
+ _effListTen.Add(index, effectList);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if (itemCfg.rarity == 3)
|
|
|
+ _effListTen[index].Add(0, _effectUI);
|
|
|
+ else if (itemCfg.rarity == 4)
|
|
|
+ _effListTen[index].Add(1, _effectUI);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (countType == 1 &&
|
|
|
+ ((itemCfg.rarity == 3 && !_effList.ContainsKey(0)) || (itemCfg.rarity == 4 && !_effList.ContainsKey(1))))
|
|
|
+ {
|
|
|
+ EffectUI _effectUI = EffectUIPool.CreateEffectUI(holder, "ui_LuckyBox", resPath);
|
|
|
+ if (itemCfg.rarity == 3)
|
|
|
+ _effList.Add(0, _effectUI);
|
|
|
+ else if (itemCfg.rarity == 4)
|
|
|
+ _effList.Add(1, _effectUI);
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
int count = 0;
|
|
|
bool isFirst = false;
|
|
|
for (int i = 0; i < _rewardList.Count; i++)
|
|
@@ -137,6 +170,7 @@ namespace GFGGame
|
|
|
item.target.onClick.Add(ShowItemTips);
|
|
|
}
|
|
|
item.target.data = itemCfg.id;
|
|
|
+
|
|
|
UI_LuckyBoxBonusShowItem.ProxyEnd();
|
|
|
}
|
|
|
|