public void RefreshList(int partsCount, int horizontalPartsCount, List <float> sizeYList = null, bool initLoc = true) { int num = partsCount / horizontalPartsCount; if (partsCount % horizontalPartsCount > 0) { num++; } Vector3 localScale = this.selectParts.transform.localScale; GUISelectPanelViewPartsUD.PanelBuildData panelBuildData = this.CalcBuildData(horizontalPartsCount, num, localScale.x, localScale.y, sizeYList); float num2 = panelBuildData.startY; float startX = panelBuildData.startX; this.partObjs.Clear(); int num3 = 0; for (int i = 0; i < partsCount; i++) { GUISelectPanelViewControlUD.ListPartsData listPartsData = this.AddBuildPart(); if (sizeYList != null) { listPartsData.sizeY = sizeYList[num3]; } float x = startX + panelBuildData.pitchW * (float)(num3 % horizontalPartsCount); listPartsData.vPos = new Vector3(x, num2, -5f); if (num3 == partsCount - 1) { break; } num3++; if (num3 % horizontalPartsCount == 0) { if (sizeYList != null) { num2 -= sizeYList[num3 - 1] / 2f + sizeYList[num3] / 2f + this.verticalMargin; } else { num2 -= panelBuildData.pitchH; } } } base.height = panelBuildData.lenH; this.initLocation = initLoc; this.InitMinMaxLocation(-1, 0f); base.InitializeView(); }
public void AllBuild(int count, bool initLoc = true, float sclX = 1f, float sclY = 1f, List <float> sizeYList = null, CMD instCMD = null, bool isResizeListArea = true) { if (this._selectParts != null) { this.GetSelectCollider(); if (!this._selectParts.activeSelf) { this._selectParts.SetActive(true); } } this.initLocation = initLoc; this.InstanceCMD = instCMD; this.InitBuild(); this.partsCount = count; int num = this.partsCount / this.PARTS_CT_MN; if (this.partsCount % this.PARTS_CT_MN > 0) { num++; } if (this.selectCollider != null) { GUISelectPanelViewPartsUD.PanelBuildData panelBuildData = this.CalcBuildData(this.PARTS_CT_MN, num, sclX, sclY, sizeYList); float num2 = panelBuildData.startY; float startX = panelBuildData.startX; int num3 = 0; for (int i = 0; i < this.partsCount; i++) { GUISelectPanelViewControlUD.ListPartsData listPartsData = this.AddBuildPart(); if (sizeYList != null) { listPartsData.sizeY = sizeYList[num3]; } float x = startX + panelBuildData.pitchW * (float)(num3 % this.PARTS_CT_MN); listPartsData.vPos = new Vector3(x, num2, this.ZPos); if (num3 == this.partsCount - 1) { break; } num3++; if (num3 % this.PARTS_CT_MN == 0) { if (sizeYList != null) { num2 -= sizeYList[num3 - 1] / 2f + sizeYList[num3] / 2f + this.verticalMargin; } else { num2 -= panelBuildData.pitchH; } } } base.height = panelBuildData.lenH; this.InitMinMaxLocation(-1, 0f); base.InitViewControl(this.selectParts, panelBuildData.pitchH, this.fRecycleViewMinY, this.fRecycleViewMaxY, this.PARTS_CT_MN, this.RecycleViewSectorSize, isResizeListArea); this.KickEffect(); } if (this._selectParts != null) { this._selectParts.SetActive(false); } }