Example #1
0
    private LoopListViewItem2 OnGetMinItemByIndex(LoopListView2 listView, int index)
    {
        LoopListViewItem2 item       = listView.NewListViewItem(ItemNameList[0]);
        LevelLimitItem    itemScript = item.GetComponent <LevelLimitItem>();

        if (item.IsInitHandlerCalled == false)
        {
            item.IsInitHandlerCalled = true;
            itemScript.Init();
        }
        int firstItemVal = 1;
        int itemCount    = MaxLevel;
        int val          = 0;

        if (index >= 0)
        {
            val = index % itemCount;
        }
        else
        {
            val = itemCount + ((index + 1) % itemCount) - 1;
        }
        val = val + firstItemVal;
        itemScript.Level = val;
        itemScript.SetData(val.ToString());
        LoopListViewMax.RefreshAllShownItem();
        return(item);
    }
Example #2
0
    private void OnMaxLevelChanged(LoopListView2 listView, LoopListViewItem2 item)
    {
        int index = listView.GetIndexInShownItemList(item);

        if (index < 0)
        {
            return;
        }
        LevelLimitItem itemScript = item.GetComponent <LevelLimitItem>();

        m_LevelMax = itemScript.Level;
    }