|
@@ -14,17 +14,18 @@ namespace GFGGame
|
|
|
|
|
|
private Action onSuccess = null;
|
|
private Action onSuccess = null;
|
|
|
|
|
|
- private List<GameObject> _effects = new List<GameObject>();
|
|
|
|
- private List<GoWrapper> _wrappers = new List<GoWrapper>();
|
|
|
|
|
|
+ private List<GMovieClip> _effects = new List<GMovieClip>();
|
|
|
|
+ // private List<GoWrapper> _wrappers = new List<GoWrapper>();
|
|
|
|
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
base.Dispose();
|
|
base.Dispose();
|
|
- for (int i = 0; i < _effects.Count; i++)
|
|
|
|
- {
|
|
|
|
- SceneController.DestroyObjectFromView(_effects[i]);
|
|
|
|
|
|
+ // _effects.c
|
|
|
|
+ // for (int i = 0; i < _effects.Count; i++)
|
|
|
|
+ // {
|
|
|
|
+ // SceneController.DestroyObjectFromView(_effects[i]);
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnInit()
|
|
protected override void OnInit()
|
|
@@ -35,9 +36,9 @@ namespace GFGGame
|
|
this.viewCom.Center();
|
|
this.viewCom.Center();
|
|
this.modal = true;
|
|
this.modal = true;
|
|
|
|
|
|
- // _ui.m_listReward.SetVirtual();
|
|
|
|
- _ui.m_listReward.itemRenderer = RenderListRewardItem;
|
|
|
|
- _ui.m_listReward.onClickItem.Add(OnClickListReward);
|
|
|
|
|
|
+ _ui.m_comListReward.m_listReward.SetVirtual();
|
|
|
|
+ _ui.m_comListReward.m_listReward.itemRenderer = RenderListRewardItem;
|
|
|
|
+ // _ui.m_comListReward.m_listReward.onClickItem.Add(OnClickListReward);
|
|
|
|
|
|
_ui.m_bg.onClick.Add(this.Hide);
|
|
_ui.m_bg.onClick.Add(this.Hide);
|
|
}
|
|
}
|
|
@@ -54,7 +55,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
_listItemDatas = this.viewData as List<ItemData>;
|
|
_listItemDatas = this.viewData as List<ItemData>;
|
|
}
|
|
}
|
|
- _ui.m_listReward.numItems = _listItemDatas.Count;
|
|
|
|
|
|
+ _ui.m_comListReward.m_listReward.numItems = _listItemDatas.Count;
|
|
}
|
|
}
|
|
protected override void OnHide()
|
|
protected override void OnHide()
|
|
{
|
|
{
|
|
@@ -66,7 +67,7 @@ namespace GFGGame
|
|
}
|
|
}
|
|
private void RenderListRewardItem(int index, GObject obj)
|
|
private void RenderListRewardItem(int index, GObject obj)
|
|
{
|
|
{
|
|
- obj.data = _listItemDatas[index];
|
|
|
|
|
|
+ // obj.data = _listItemDatas[index];
|
|
UI_ListRewardItem item = UI_ListRewardItem.Proxy(obj);
|
|
UI_ListRewardItem item = UI_ListRewardItem.Proxy(obj);
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_listItemDatas[index].id);
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_listItemDatas[index].id);
|
|
item.m_comRewardItem.m_txtName.text = itemCfg.name;
|
|
item.m_comRewardItem.m_txtName.text = itemCfg.name;
|
|
@@ -74,21 +75,26 @@ namespace GFGGame
|
|
item.m_comRewardItem.m_txtCount.text = string.Format("x{0}", _listItemDatas[index].num);
|
|
item.m_comRewardItem.m_txtCount.text = string.Format("x{0}", _listItemDatas[index].num);
|
|
item.m_comRewardItem.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
|
|
item.m_comRewardItem.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
|
|
string resPath = ResPathUtil.GetViewEffectPath("ui_ck", "ui_ck_zl");
|
|
string resPath = ResPathUtil.GetViewEffectPath("ui_ck", "ui_ck_zl");
|
|
- int childIndex = _ui.m_listReward.ItemIndexToChildIndex(index);
|
|
|
|
- // if (_effects.Count <= index)
|
|
|
|
- // {
|
|
|
|
- // GameObject gameObject0;
|
|
|
|
- // GoWrapper wrapper0;
|
|
|
|
- // SceneController.AddObjectToView(null, null, item.m_holder, resPath, out gameObject0, out wrapper0);
|
|
|
|
- // _effects.Add(gameObject0);
|
|
|
|
- // item.m_t0.Play();
|
|
|
|
- // }
|
|
|
|
|
|
+ int childIndex = _ui.m_comListReward.m_listReward.ItemIndexToChildIndex(index);
|
|
|
|
+ if (_effects.Count <= childIndex)
|
|
|
|
+ {
|
|
|
|
+ // GameObject gameObject0;
|
|
|
|
+ // GoWrapper wrapper0;
|
|
|
|
+ // SceneController.AddObjectToView(null, null, item.m_holder, resPath, out gameObject0, out wrapper0);
|
|
|
|
+ _effects.Add(item.m_effect);
|
|
|
|
+ item.m_t0.Play();
|
|
|
|
+ }
|
|
|
|
+ if (item.m_comRewardItem.target.data == null)
|
|
|
|
+ {
|
|
|
|
+ item.m_comRewardItem.target.onClick.Add(OnClickListReward);
|
|
|
|
+ }
|
|
|
|
+ item.m_comRewardItem.target.data = _listItemDatas[index];
|
|
}
|
|
}
|
|
private void OnClickListReward(EventContext context)
|
|
private void OnClickListReward(EventContext context)
|
|
{
|
|
{
|
|
if (this.ShowTips)
|
|
if (this.ShowTips)
|
|
{
|
|
{
|
|
- ItemData data = (context.data as GObject).data as ItemData;
|
|
|
|
|
|
+ ItemData data = (context.sender as GObject).data as ItemData;
|
|
GoodsItemTipsController.ShowItemTips(data.id);
|
|
GoodsItemTipsController.ShowItemTips(data.id);
|
|
}
|
|
}
|
|
}
|
|
}
|