private void BuildFirstView() { if (this.csPartsList == null) { this.csPartsList = new List <GUISelectPanelViewControlUD.ListPartsRecycle>(); int num = this.x_size * this.sector_size * this.sector_ct; GUIListPartBS component = this.goParts.GetComponent <GUIListPartBS>(); for (int i = 0; i < num; i++) { GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.goParts); GUIListPartBS component2 = gameObject.GetComponent <GUIListPartBS>(); component2.parent = this; component2.ReceiveOriginalParts(component); Vector3 localScale = component2.transform.localScale; component2.transform.parent = base.transform; localScale.x *= this._sclX; localScale.y *= this._sclY; component2.transform.localScale = localScale; GUISelectPanelViewControlUD.ListPartsRecycle listPartsRecycle = new GUISelectPanelViewControlUD.ListPartsRecycle(); listPartsRecycle.csParts = component2; listPartsRecycle.csParts.IDX = -1; listPartsRecycle.isInit = false; this.csPartsList.Add(listPartsRecycle); gameObject.SetActive(false); } } }
protected GameObject InsertBuildPart(int loc) { GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.selectParts); Vector3 localScale = gameObject.transform.localScale; gameObject.transform.parent = base.transform; gameObject.transform.localScale = localScale; if (this.partObjs != null) { if (loc < 0) { loc = 0; } if (loc > this.partObjs.Count) { loc = this.partObjs.Count; } GUIListPartBS component = gameObject.GetComponent <GUIListPartBS>(); if (component != null) { this.partObjs.Insert(loc, component); } } return(gameObject); }
public void AllBuild(int listItemCount) { base.InitBuild(); this.partsCount = listItemCount; float height = base.selectCollider.height; float width = base.selectCollider.width; float num = height + this.verticalMargin; float num2 = width + this.horizontalMargin; int num3 = this.partsCount / this.horizontalPartsCount; if (this.partsCount % this.horizontalPartsCount > 0) { num3++; } float num4 = (float)num3 * num + this.verticalBorder * 2f; num4 -= this.verticalMargin; float num5 = base.ListWindowViewRect.xMin + this.horizontalBorder + width * 0.5f; float num6 = num4 * 0.5f - this.verticalBorder - height * 0.5f; for (int i = 0; i < listItemCount; i++) { float x = num5 + num2 * (float)(i % this.horizontalPartsCount); float y = num6 - num * (float)(i / this.horizontalPartsCount); GUIListPartBS component = base.AddBuildPart().GetComponent <GUIListPartBS>(); component.SetOriginalPos(new Vector3(x, y, -5f)); } base.height = num4; base.InitMinMaxLocation(-1, 0f); }
private void DoPanelAreaOverBottomAction(GUIListPartBS obj) { if (this.panelAreaOverBottomAction != null) { this.panelAreaOverBottomAction(obj); } }
protected GameObject AddBuildPart() { GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.selectParts); if (this.goListPartsRoot != null) { gameObject.transform.parent = this.goListPartsRoot.transform; } else { Vector3 localScale = gameObject.transform.localScale; gameObject.transform.parent = base.transform; gameObject.transform.localScale = localScale; } if (this.partObjs != null) { GUIListPartBS component = gameObject.GetComponent <GUIListPartBS>(); if (component != null) { component.IDX = this.partObjs.Count; this.partObjs.Add(component); } } return(gameObject); }
public override void ReceiveOriginalParts(GUIListPartBS originalParts) { UI_SaleBonusCheckListItem ui_SaleBonusCheckListItem = originalParts as UI_SaleBonusCheckListItem; if (null != ui_SaleBonusCheckListItem) { this.getSaleBonus = ui_SaleBonusCheckListItem.getSaleBonus; this.getBonusAssetNum = ui_SaleBonusCheckListItem.getBonusAssetNum; } }
public void SetCellAnimReserve(int selectedIndex, bool resetNew = true) { if (this.partObjs[selectedIndex].csParts != null) { GUIListPartBS csParts = this.partObjs[selectedIndex].csParts; csParts.SetFadeInEndCallBack(delegate { this.SetCellAnim(selectedIndex, resetNew); }); } }
private void RemakeListForEternalScroll() { GUISelectPanelBSPartsLR guiselectPanelBSPartsLR = (GUISelectPanelBSPartsLR)this; float num = guiselectPanelBSPartsLR.selectCollider.width + guiselectPanelBSPartsLR.horizontalMargin; while (this.selectLoc > this.maxLocate_) { this.maxLocate_ += num; this.minLocate_ += num; Vector3 localPosition = this.partObjs[this.partObjs.Count - 1].gameObject.transform.localPosition; localPosition.x -= num; GUIListPartBS guilistPartBS = this.partObjs[0]; this.partObjs.RemoveAt(0); this.partObjs.Add(guilistPartBS); guilistPartBS.gameObject.transform.localPosition = localPosition; for (int i = 0; i < this.partObjs.Count; i++) { this.partObjs[i].IDX = i; } } while (this.selectLoc < this.minLocate_) { this.maxLocate_ -= num; this.minLocate_ -= num; Vector3 localPosition = this.partObjs[0].gameObject.transform.localPosition; localPosition.x += num; GUIListPartBS guilistPartBS = this.partObjs[this.partObjs.Count - 1]; this.partObjs.RemoveAt(this.partObjs.Count - 1); this.partObjs.Insert(0, guilistPartBS); guilistPartBS.gameObject.transform.localPosition = localPosition; for (int i = 0; i < this.partObjs.Count; i++) { this.partObjs[i].IDX = i; } } }
private void UpdatePartPosAll() { for (int i = 0; i < this.partObjs.Count; i++) { GUIListPartBS guilistPartBS = this.partObjs[i]; if (guilistPartBS != null) { Vector3 currentTransPosByIdx = this.GetCurrentTransPosByIdx(i); Vector3 localPosition = guilistPartBS.gameObject.transform.localPosition; localPosition.x = currentTransPosByIdx.x; localPosition.y = currentTransPosByIdx.y; localPosition.z = currentTransPosByIdx.z; guilistPartBS.gameObject.transform.localPosition = localPosition; guilistPartBS.gameObject.transform.localRotation = this.lastQt; if (this.isRotParts && !this.isRotPartsPlus) { guilistPartBS.gameObject.transform.localScale = this.lastScale; } } if (this.stopAtEnd) { int selectedIdx = this.GetSelectedIdx(); int num = guilistPartBS.IDX - selectedIdx; if (num < 0) { num = -num; } if (num > 5) { Vector3 localPosition2 = guilistPartBS.gameObject.transform.localPosition; localPosition2.y += 2000f; guilistPartBS.gameObject.transform.localPosition = localPosition2; } } } }
public virtual void ReceiveOriginalParts(GUIListPartBS originalParts) { }