Example #1
0
    /// <summary>
    /// 单个数据回调
    /// </summary>
    /// <param name="itemCell"></param>
    public void OnCellForItem(ScrollGridCell itemCell)
    {
        UIViewItemContainer viewItemContainer = itemCell.GetComponent <UIViewItemContainer>();
        ItemsBean           itemsData         = blockBoxData.items[itemCell.index];

        viewItemContainer.SetData(UIViewItemContainer.ContainerType.Box, itemsData, itemCell.index);
    }
    /// <summary>
    /// 单个数据回调
    /// </summary>
    /// <param name="itemCell"></param>
    public void OnCellForItem(ScrollGridCell itemCell)
    {
        UserDataBean        userData          = GameDataHandler.Instance.manager.GetUserData();
        UIViewItemContainer viewItemContainer = itemCell.GetComponent <UIViewItemContainer>();
        ItemsBean           itemsData         = userData.GetItemsFromBackpack(itemCell.index);

        viewItemContainer.SetData(UIViewItemContainer.ContainerType.Backpack, itemsData, itemCell.index);
    }
Example #3
0
    /// <summary>
    /// 单个数据回调
    /// </summary>
    /// <param name="itemCell"></param>
    public void OnCellForItem(ScrollGridCell itemCell)
    {
        UIViewItemContainer viewItemContainer = itemCell.GetComponent <UIViewItemContainer>();
        ItemsInfoBean       itemsInfo         = listItemsInfo[itemCell.index];
        ItemsBean           itemsData         = new ItemsBean();

        itemsData.itemId = itemsInfo.id;
        itemsData.number = int.MaxValue;
        viewItemContainer.SetData(UIViewItemContainer.ContainerType.God, itemsData, itemCell.index);
    }