예제 #1
0
 protected virtual void Awake()
 {
     this.m_RectTransform = (RectTransform)((Component)this).get_gameObject().GetComponent <RectTransform>();
     if (Object.op_Equality((Object)this.m_Scroller, (Object)null))
     {
         this.m_Scroller = (ContentScroller)((Component)this).get_gameObject().GetComponentInParent <ContentScroller>();
     }
     if (Object.op_Inequality((Object)this.m_Node, (Object)null))
     {
         this.m_NodeStatic = false;
         ((Component)this.m_Node).get_gameObject().SetActive(false);
     }
     else
     {
         this.m_NodeStatic = true;
         this.Initialize((ContentSource)null, Vector2.get_zero());
     }
 }
예제 #2
0
        private void InitializeParam()
        {
            if (Object.op_Equality((Object)this.m_RectTransform, (Object)null))
            {
                this.m_RectTransform = (RectTransform)((Component)this).get_gameObject().GetComponent <RectTransform>();
            }
            if (Object.op_Equality((Object)this.m_Scroller, (Object)null))
            {
                this.m_Scroller = (ContentScroller)((Component)this).get_gameObject().GetComponentInParent <ContentScroller>();
            }
            if (!Object.op_Inequality((Object)this.m_RectTransform, (Object)null))
            {
                return;
            }
            this.m_RectTransform.set_anchorMin(new Vector2(0.0f, 1f));
            this.m_RectTransform.set_anchorMax(new Vector2(0.0f, 1f));
            this.m_RectTransform.set_pivot(new Vector2(0.0f, 1f));
            if (Object.op_Inequality((Object)this.m_Scroller, (Object)null))
            {
                // ISSUE: explicit reference operation
                // ISSUE: variable of a reference type
                Vector2& local1 = @this.m_PageSize;
                Rect     rect1  = this.m_Scroller.get_viewport().get_rect();
                // ISSUE: explicit reference operation
                double width = (double)((Rect)@rect1).get_width();
                // ISSUE: explicit reference operation
                (^ local1).x = (__Null)width;
                // ISSUE: explicit reference operation
                // ISSUE: variable of a reference type
                Vector2& local2 = @this.m_PageSize;
                Rect     rect2  = this.m_Scroller.get_viewport().get_rect();
                // ISSUE: explicit reference operation
                double height = (double)((Rect)@rect2).get_height();
                // ISSUE: explicit reference operation
                (^ local2).y = (__Null)height;
            }
            else
            {
                // ISSUE: explicit reference operation
                // ISSUE: variable of a reference type
                Vector2& local1 = @this.m_PageSize;
                Rect     rect1  = this.m_RectTransform.get_rect();
                // ISSUE: explicit reference operation
                double width = (double)((Rect)@rect1).get_width();
                // ISSUE: explicit reference operation
                (^ local1).x = (__Null)width;
                // ISSUE: explicit reference operation
                // ISSUE: variable of a reference type
                Vector2& local2 = @this.m_PageSize;
                Rect     rect2  = this.m_RectTransform.get_rect();
                // ISSUE: explicit reference operation
                double height = (double)((Rect)@rect2).get_height();
                // ISSUE: explicit reference operation
                (^ local2).y = (__Null)height;
            }
            Vector2 pageSize = this.m_PageSize;

            if (this.m_Constraint == ContentController.Constraint.Flexible)
            {
                // ISSUE: explicit reference operation
                // ISSUE: variable of a reference type
                Vector2& local1 = @pageSize;
                // ISSUE: explicit reference operation
                // ISSUE: explicit reference operation
                (^ local1).x = (__Null)((^ local1).x - ((double)this.m_PaddingLeft + (double)this.m_PaddingRight));
                // ISSUE: explicit reference operation
                // ISSUE: variable of a reference type
                Vector2& local2 = @pageSize;
                // ISSUE: explicit reference operation
                // ISSUE: explicit reference operation
                (^ local2).y         = (__Null)((^ local2).y - ((double)this.m_PaddingTop + (double)this.m_PaddingBottom));
                this.m_NodeWidthNum  = Mathf.CeilToInt((float)((pageSize.x + this.m_Spacing.x) / (this.m_CellSize.x + this.m_Spacing.x)));
                this.m_NodeHeightNum = Mathf.CeilToInt((float)((pageSize.y + this.m_Spacing.y) / (this.m_CellSize.y + this.m_Spacing.y)));
            }
            else if (this.m_Constraint == ContentController.Constraint.FixedColumnCount)
            {
                // ISSUE: explicit reference operation
                // ISSUE: variable of a reference type
                Vector2& local = @pageSize;
                // ISSUE: explicit reference operation
                // ISSUE: explicit reference operation
                (^ local).y          = (__Null)((^ local).y - ((double)this.m_PaddingTop + (double)this.m_PaddingBottom));
                this.m_NodeWidthNum  = this.m_ConstraintCount;
                this.m_NodeHeightNum = Mathf.CeilToInt((float)((pageSize.y + this.m_Spacing.y) / (this.m_CellSize.y + this.m_Spacing.y)));
            }
            else
            {
                if (this.m_Constraint != ContentController.Constraint.FixedRowCount)
                {
                    return;
                }
                // ISSUE: explicit reference operation
                // ISSUE: variable of a reference type
                Vector2& local = @pageSize;
                // ISSUE: explicit reference operation
                // ISSUE: explicit reference operation
                (^ local).x          = (__Null)((^ local).x - ((double)this.m_PaddingLeft + (double)this.m_PaddingRight));
                this.m_NodeWidthNum  = Mathf.CeilToInt((float)((pageSize.x + this.m_Spacing.x) / (this.m_CellSize.x + this.m_Spacing.x)));
                this.m_NodeHeightNum = this.m_ConstraintCount;
            }
        }