コード例 #1
0
        public ScrollDataFixed <T> Init(ScrollDataView scroll_, Func <RectTransform, T> PrepareT_, Action <T, bool> SwitchT_, string templateName_ = "entry")
        {
            _scroll        = scroll_;
            elementPerLine = 1;
            PrepareT       = PrepareT_;
            SwitchT        = SwitchT_;
            template       = (RectTransform)_scroll.content.Find(templateName_);
            template.gameObject.SetActive(false);
            defaultElementSize = template.sizeDelta;
            entry = new StorageList <Entry <T> >(64, 16, InitEntry);
            var e = PrepareT(template);

            entry.Add(new Entry <T>()
            {
                transform = template,
                item      = e
            });
            return(this);
        }
コード例 #2
0
        public ScrollDataFlex <T> Init(ScrollDataView scroll_, Func <RectTransform, T> PrepareT_, Action <T, bool> SwitchT_)
        {
            _scroll        = scroll_;
            elementPerLine = 1;
            headPadding    = 0;
            tailPadding    = 0;
            recyclePadding = DefaultRecyclePadding;
            SwitchT        = SwitchT_;
            PrepareT       = PrepareT_;
            template       = (RectTransform)_scroll.content.Find("entry");
            template.gameObject.SetActive(false);
            defaultElementSize = template.sizeDelta;
            entry = new StorageList <Entry <T> >(128, 16, InitEntry);
            var e = PrepareT(template);

            entry.Add(new Entry <T>()
            {
                transform = template,
                item      = e
            });
            return(this);
        }