示例#1
0
    public virtual void InitContentItem(IEnumerable valueList, UIItemBase.ItemClick onClick = null, Hashtable exhash = null, UIItemBase.PanelClick onPanelClick = null)
    {
        //CalculateRect(valueList);
        _ValueList.Clear();
        //ClearPrefab();
        int i = 0;

        if (valueList == null)
        {
            ClearPrefab();
            return;
        }
        var enumerator = valueList.GetEnumerator();

        enumerator.Reset();
        while (enumerator.MoveNext())
        {
            var contentPos = new ContentPos();
            contentPos.Obj = enumerator.Current;
            _ValueList.Add(contentPos);

            ++i;
        }

        _InitItemCount = 50;
        _InitItemCount = Math.Min(_InitItemCount, _ValueList.Count);

        _HasInit      = false;
        _OnClickItem  = onClick;
        _OnClickPanel = onPanelClick;
        _ExHash       = exhash;
        if (isActiveAndEnabled)
        {
            StartInitContainer();
        }

        //_LayoutGroup.enabled = false;
    }
示例#2
0
    public override void InitContentItem(IEnumerable list, UIItemBase.ItemClick onClick = null, Hashtable exhash = null, UIItemBase.PanelClick onPanelClick = null)
    {
        base.InitContentItem(list, onClick, exhash, onPanelClick);

        //_MaxPage = (int)(_ActivedItems.Count / _ItemCountPrePage);
        //if (_ActivedItems.Count % _ItemCountPrePage > 0)
        //{
        //    ++_MaxPage;
        //}
        _TotalWidth = _MaxPage * _ItemCountPrePage * _ItemWidth;
    }
示例#3
0
 public override void InitContentItem(IEnumerable valueList, UIItemBase.ItemClick onClick = null, Hashtable exhash = null, UIItemBase.PanelClick onPanelClick = null)
 {
     //base.InitContentItem(valueList, onClick, exhash);
 }
    public override void InitContentItem(IEnumerable valueList, UIItemBase.ItemClick onClick = null, Hashtable exhash = null, UIItemBase.PanelClick onPanelClick = null)
    {
        base.InitContentItem(valueList, onClick, exhash, onPanelClick);

        _StepHeight     = _LayoutGroup.cellSize.y + _LayoutGroup.spacing.y;
        _StepHeightHalf = _LayoutGroup.cellSize.y * 0.5f;
        _ContentYMin    = -_ScrollTransform.sizeDelta.y * 0.5f;
        _StepMin        = (int)(_ContentYMin / _StepHeight);

        _StepMax     = _StepMin + _ValueList.Count - 1;
        _ContentYMax = _StepMax * _StepHeight;

        _SelectedStepDelta = -_StepMin;

        _SelectedStep = _SelectedStepDelta;
    }