public void ScrollIntoView(object obj)
        {
            int index = IndexOf(obj);

            if (index < 0)
            {
                throw new InvalidOperationException(string.Format("item {0} does not exist or not visible", obj));
            }
            VirtualizingScrollRect scrollRect = GetComponentInChildren <VirtualizingScrollRect>();

            scrollRect.Index = index;
        }
        protected override void AwakeOverride()
        {
            base.AwakeOverride();
            this.m_treeView = (VirtualizingTreeView)((Component)this).GetComponentInParent <VirtualizingTreeView>();
            this.m_siblingGraphicsRectTransform = (RectTransform)this.SiblingGraphics.GetComponent <RectTransform>();
            RectTransform          transform           = (RectTransform)((Component)this).get_transform();
            VirtualizingScrollRect componentInChildren = (VirtualizingScrollRect)((Component)this.m_treeView).GetComponentInChildren <VirtualizingScrollRect>();

            if (Object.op_Inequality((Object)componentInChildren, (Object)null) && componentInChildren.UseGrid)
            {
                this.m_useGrid = true;
                transform.set_anchorMin(Vector2.get_zero());
                transform.set_anchorMax(Vector2.get_zero());
            }
            else
            {
                transform.set_anchorMin(Vector2.get_zero());
                transform.set_anchorMax(new Vector2(1f, 0.0f));
            }
        }
示例#3
0
        protected override void AwakeOverride()
        {
            base.AwakeOverride();
            m_treeView = GetComponentInParent <VirtualizingTreeView>();
            m_siblingGraphicsRectTransform = SiblingGraphics.GetComponent <RectTransform>();

            RectTransform          rectTransform = (RectTransform)transform;
            VirtualizingScrollRect scrollRect    = m_treeView.GetComponentInChildren <VirtualizingScrollRect>();

            if (scrollRect != null && scrollRect.UseGrid)
            {
                m_useGrid = true;
                rectTransform.anchorMin = Vector2.zero;
                rectTransform.anchorMax = Vector2.zero;
            }
            else
            {
                rectTransform.anchorMin = Vector2.zero;
                rectTransform.anchorMax = new Vector2(1, 0);
            }
        }