/// <summary> /// 创建一个格子 by吴江 /// </summary> /// <param name="_index"></param> void AddOneGrid(int _index) { if (girdDic.ContainsKey(_index)) { girdDic[_index].FillInfo(null); girdDic[_index].gameObject.SetActive(true); return; } ItemUI go = null; if (itemPrefab != null) { go = ItemUI.CreatNewByPrefab(GridMgr, _index, itemPrefab.gameObject); } else { go = ItemUI.CreatNew(GridMgr, _index, triggerGridFrame ? GridMgr.gameObject : null); } if (go != null) { go.ShowTooltip = ShowToolTip; go.showZeroCount = showZeroCount; go.showUIType = showUIType; go.SetActionBtn(leftAction, middleAction, rightAction); go.FillInfo(null); go.OnSelectEvent += OnSelectItemUI; girdDic[_index] = go; } }