コード例 #1
0
        public ContentGrid GetGrid(Vector2 pos)
        {
            ContentGrid zero = ContentGrid.zero;

            if (Object.op_Inequality((Object)this.m_RectTransform, (Object)null))
            {
                // ISSUE: explicit reference operation
                // ISSUE: variable of a reference type
                Vector2& local1 = @pos;
                // ISSUE: explicit reference operation
                // ISSUE: explicit reference operation
                (^ local1).x = (__Null)((^ local1).x + ((double)this.m_PaddingLeft - this.m_Spacing.x));
                zero.fx      = (float)(-pos.x / (this.m_CellSize.x + this.m_Spacing.x));
                // ISSUE: explicit reference operation
                // ISSUE: variable of a reference type
                Vector2& local2 = @pos;
                // ISSUE: explicit reference operation
                // ISSUE: explicit reference operation
                (^ local2).y = (__Null)((^ local2).y - ((double)this.m_PaddingTop - this.m_Spacing.y));
                zero.fy      = (float)(pos.y / (this.m_CellSize.y + this.m_Spacing.y));
                if (!this.m_WidthLoop && zero.x < 0)
                {
                    zero.x = 0;
                }
                if (!this.m_HeightLoop && zero.y < 0)
                {
                    zero.y = 0;
                }
            }
            return(zero);
        }
コード例 #2
0
ファイル: ContentNode.cs プロジェクト: zunaalabaya/TAC-BOT
 public virtual void Copy(ContentNode src)
 {
     this.m_ContentController = src.m_ContentController;
     this.m_Index             = src.m_Index;
     this.m_Param             = src.m_Param;
     this.m_Grid = src.m_Grid;
     this.m_Pos  = src.m_Pos;
 }
コード例 #3
0
        public int GetParamIndex(int x, int y)
        {
            ContentGrid normalizeGrid = this.GetNormalizeGrid(x, y);

            if (this.m_Constraint == ContentController.Constraint.FixedRowCount)
            {
                return(normalizeGrid.x * this.m_ViewHeightNum + normalizeGrid.y);
            }
            return(normalizeGrid.y * this.m_ViewWidthNum + normalizeGrid.x);
        }
コード例 #4
0
        public ContentGrid GetGrid(int index)
        {
            ContentGrid zero = ContentGrid.zero;

            if (this.m_Constraint == ContentController.Constraint.Flexible || this.m_Constraint == ContentController.Constraint.FixedRowCount)
            {
                zero.x = index / this.m_ViewHeightNum;
                zero.y = index % this.m_ViewHeightNum;
            }
            else if (this.m_Constraint == ContentController.Constraint.FixedColumnCount)
            {
                zero.x = index % this.m_ViewWidthNum;
                zero.y = index / this.m_ViewWidthNum;
            }
            return(zero);
        }
コード例 #5
0
ファイル: ContentNode.cs プロジェクト: zunaalabaya/TAC-BOT
 public void SetGrid(ContentGrid grid)
 {
     this.m_Grid = grid;
 }
コード例 #6
0
ファイル: ContentNode.cs プロジェクト: zunaalabaya/TAC-BOT
 public virtual void Setup(int index, int x, int y, ContentSource.Param param)
 {
     this.m_Grid = new ContentGrid(x, y);
     this.Setup(index, this.m_ContentController.GetNodePos(x, y), param);
 }
コード例 #7
0
        private void CheckActiveNode()
        {
            ContentGrid           grid            = this.GetGrid();
            List <ContentNode>    contentNodeList = new List <ContentNode>();
            IDictionaryEnumerator enumerator      = (IDictionaryEnumerator)this.m_NodeUsed.GetEnumerator();

            while (enumerator.MoveNext())
            {
                ContentNode contentNode = (ContentNode)enumerator.Value;
                if (Object.op_Inequality((Object)contentNode, (Object)null) && (contentNode.IsReMake() || !contentNode.IsValid() || (contentNode.gridX < grid.x - 1 || contentNode.gridX > grid.x + this.m_NodeWidthNum) || (contentNode.gridY < grid.y - 1 || contentNode.gridY > grid.y + this.m_NodeHeightNum)))
                {
                    contentNodeList.Add(contentNode);
                }
            }
            for (int index = 0; index < contentNodeList.Count; ++index)
            {
                ContentNode contentNode = contentNodeList[index];
                if (Object.op_Inequality((Object)contentNode, (Object)null))
                {
                    contentNode.OnSelectOff();
                    contentNode.SetActive(false);
                    this.m_NodeUsed.Remove(this.GetNodeKey(contentNode.gridX, contentNode.gridY));
                    this.m_NodeEmpty.Add(contentNode);
                }
            }
            int x1   = grid.x;
            int y1   = grid.y;
            int num1 = grid.x + this.m_NodeWidthNum;
            int num2 = grid.y + this.m_NodeHeightNum;

            if (this.isScrollHorizontal)
            {
                --x1;
                ++num1;
            }
            if (this.isScrollVertical)
            {
                --y1;
                ++num2;
            }
            for (int y2 = y1; y2 < num2; ++y2)
            {
                for (int x2 = x1; x2 < num1; ++x2)
                {
                    if ((this.m_WidthLoop || x2 >= 0 && x2 < this.m_ViewWidthNum) && (this.m_HeightLoop || y2 >= 0 && y2 < this.m_ViewHeightNum) && Object.op_Equality((Object)this.GetNodeUsed(x2, y2), (Object)null))
                    {
                        int paramIndex          = this.GetParamIndex(x2, y2);
                        ContentSource.Param obj = this.GetParam(paramIndex);
                        if (obj != null)
                        {
                            ContentNode nodeEmpty = this.GetNodeEmpty();
                            if (Object.op_Inequality((Object)nodeEmpty, (Object)null))
                            {
                                nodeEmpty.Setup(paramIndex, x2, y2, obj);
                                nodeEmpty.SetActive(true);
                                this.m_NodeUsed.Add(this.GetNodeKey(x2, y2), nodeEmpty);
                            }
                            else
                            {
                                Debug.LogError((object)"ノードが不足しています");
                            }
                        }
                    }
                }
            }
        }
コード例 #8
0
ファイル: ContentGrid.cs プロジェクト: zunaalabaya/TAC-BOT
 public ContentGrid(float _fx, float _fy)
 {
     this.x = ContentGrid.FloatToInt(_fx);
     this.y = ContentGrid.FloatToInt(_fy);
 }