Exemplo n.º 1
0
    private void UpdateList(HelpType type)
    {
        if (_type == type)
        {
            return;
        }
        _type = type;

        UpdateCellList();
        foreach (CheatsData x in CheatsData.GetData().Values)
        {
            if (x.type_ == type)
            {
                GameObject objCell = null;
                if (cellPool.Count > 0)
                {
                    objCell = cellPool[0];
                    cellPool.Remove(objCell);
                    UIManager.RemoveButtonAllEventHandler(objCell);
                }
                else
                {
                    objCell = Object.Instantiate(cell) as GameObject;
                }


                HelpBookCellUI cellUI = objCell.GetComponent <HelpBookCellUI>();
                cellUI.Cheats = x;
                //UIManager.SetButtonEventHandler (objCell, EnumButtonEvent.OnClick, OnClickSkill, 0, 0);
                objCell.transform.parent = grid.transform;
                objCell.gameObject.SetActive(true);
                objCell.transform.localScale = Vector3.one;
                cellList.Add(objCell);
            }
        }
        grid.Reposition();
    }