public uint SetItemPriceInfo(CMallItemWidget itemWidget, ref stPayInfoSet payInfoSet) { uint payValue = 0; if (itemWidget.m_priceContainer != null) { itemWidget.m_priceContainer.SetActive(true); CMallItem.OldPriceType oldPriceType = this.GetOldPriceType(); CUIListScript component = itemWidget.m_priceContainer.GetComponent <CUIListScript>(); component.SetElementAmount(1); itemWidget.m_orTextContainer.CustomSetActive(false); CUIListElementScript elemenet = component.GetElemenet(0); if (elemenet == null) { return(payValue); } GameObject widget = elemenet.GetWidget(0); GameObject obj3 = elemenet.GetWidget(1); GameObject obj4 = elemenet.GetWidget(2); GameObject obj5 = elemenet.GetWidget(4); GameObject obj6 = elemenet.GetWidget(3); GameObject obj7 = elemenet.GetWidget(5); if ((((widget == null) || (obj3 == null)) || ((obj4 == null) || (obj5 == null))) || ((obj6 == null) || (obj7 == null))) { return(payValue); } for (int i = 0; i < payInfoSet.m_payInfoCount; i++) { if ((payInfoSet.m_payInfos[i].m_payType == enPayType.Diamond) || (payInfoSet.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan)) { payInfoSet.m_payInfos[i].m_payType = enPayType.DianQuan; } } for (int j = 0; j < payInfoSet.m_payInfoCount; j++) { if (((payInfoSet.m_payInfos[j].m_payType != enPayType.DianQuan) && (payInfoSet.m_payInfos[j].m_payType != enPayType.Diamond)) && (payInfoSet.m_payInfos[j].m_payType != enPayType.DiamondAndDianQuan)) { continue; } payValue = payInfoSet.m_payInfos[j].m_payValue; switch (oldPriceType) { case CMallItem.OldPriceType.None: itemWidget.m_middleOrText.CustomSetActive(true); itemWidget.m_bottomOrText.CustomSetActive(false); widget.SetActive(false); obj3.SetActive(false); obj4.SetActive(false); obj6.SetActive(true); obj6.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_payValue.ToString(); obj7.GetComponent <Image>().SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false); return(payValue); case CMallItem.OldPriceType.FirstOne: itemWidget.m_middleOrText.CustomSetActive(false); itemWidget.m_bottomOrText.CustomSetActive(true); if (j != 0) { break; } obj3.SetActive(false); obj6.SetActive(false); widget.SetActive(true); obj4.SetActive(true); widget.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_oriValue.ToString(); obj4.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_payValue.ToString(); obj5.GetComponent <Image>().SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false); return(payValue); case CMallItem.OldPriceType.SecondOne: itemWidget.m_middleOrText.CustomSetActive(false); itemWidget.m_bottomOrText.CustomSetActive(true); if (j != 1) { goto Label_045D; } obj3.SetActive(false); obj6.SetActive(false); widget.SetActive(true); obj4.SetActive(true); widget.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_oriValue.ToString(); obj4.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_payValue.ToString(); obj5.GetComponent <Image>().SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false); return(payValue); case CMallItem.OldPriceType.Both: itemWidget.m_middleOrText.CustomSetActive(true); itemWidget.m_bottomOrText.CustomSetActive(false); obj3.SetActive(false); obj6.SetActive(false); widget.SetActive(true); obj4.SetActive(true); widget.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_oriValue.ToString(); obj4.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_payValue.ToString(); obj5.GetComponent <Image>().SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false); return(payValue); default: return(payValue); } obj3.SetActive(false); widget.SetActive(false); obj6.SetActive(false); obj4.SetActive(true); obj4.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_payValue.ToString(); obj5.GetComponent <Image>().SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false); return(payValue); Label_045D: obj3.SetActive(false); widget.SetActive(false); obj6.SetActive(false); obj4.SetActive(true); obj4.GetComponent <Text>().text = payInfoSet.m_payInfos[j].m_payValue.ToString(); obj5.GetComponent <Image>().SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false); return(payValue); } } return(payValue); }
public uint SetItemPriceInfo(CMallItemWidget itemWidget, ref stPayInfoSet payInfoSet) { uint result = 0u; if (itemWidget.m_priceContainer == null) { return(result); } itemWidget.m_priceContainer.SetActive(true); CMallItem.OldPriceType oldPriceType = this.GetOldPriceType(); CUIListScript component = itemWidget.m_priceContainer.GetComponent <CUIListScript>(); component.SetElementAmount(1); itemWidget.m_orTextContainer.CustomSetActive(false); CUIListElementScript elemenet = component.GetElemenet(0); if (elemenet == null) { return(result); } GameObject widget = elemenet.GetWidget(0); GameObject widget2 = elemenet.GetWidget(1); GameObject widget3 = elemenet.GetWidget(2); GameObject widget4 = elemenet.GetWidget(4); GameObject widget5 = elemenet.GetWidget(3); GameObject widget6 = elemenet.GetWidget(5); if (widget == null || widget2 == null || widget3 == null || widget4 == null || widget5 == null || widget6 == null) { return(result); } for (int i = 0; i < payInfoSet.m_payInfoCount; i++) { if (payInfoSet.m_payInfos[i].m_payType == enPayType.Diamond || payInfoSet.m_payInfos[i].m_payType == enPayType.DiamondAndDianQuan) { payInfoSet.m_payInfos[i].m_payType = enPayType.DianQuan; } } for (int j = 0; j < payInfoSet.m_payInfoCount; j++) { if (payInfoSet.m_payInfos[j].m_payType == enPayType.DianQuan || payInfoSet.m_payInfos[j].m_payType == enPayType.Diamond || payInfoSet.m_payInfos[j].m_payType == enPayType.DiamondAndDianQuan) { result = payInfoSet.m_payInfos[j].m_payValue; switch (oldPriceType) { case CMallItem.OldPriceType.None: { itemWidget.m_middleOrText.CustomSetActive(true); itemWidget.m_bottomOrText.CustomSetActive(false); widget.SetActive(false); widget2.SetActive(false); widget3.SetActive(false); widget5.SetActive(true); Text component2 = widget5.GetComponent <Text>(); component2.set_text(payInfoSet.m_payInfos[j].m_payValue.ToString()); Image component3 = widget6.GetComponent <Image>(); component3.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false); break; } case CMallItem.OldPriceType.FirstOne: itemWidget.m_middleOrText.CustomSetActive(false); itemWidget.m_bottomOrText.CustomSetActive(true); if (j == 0) { widget2.SetActive(false); widget5.SetActive(false); widget.SetActive(true); widget3.SetActive(true); Text component4 = widget.GetComponent <Text>(); component4.set_text(payInfoSet.m_payInfos[j].m_oriValue.ToString()); Text component5 = widget3.GetComponent <Text>(); component5.set_text(payInfoSet.m_payInfos[j].m_payValue.ToString()); Image component6 = widget4.GetComponent <Image>(); component6.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false); } else { widget2.SetActive(false); widget.SetActive(false); widget5.SetActive(false); widget3.SetActive(true); Text component7 = widget3.GetComponent <Text>(); component7.set_text(payInfoSet.m_payInfos[j].m_payValue.ToString()); Image component8 = widget4.GetComponent <Image>(); component8.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false); } break; case CMallItem.OldPriceType.SecondOne: itemWidget.m_middleOrText.CustomSetActive(false); itemWidget.m_bottomOrText.CustomSetActive(true); if (j == 1) { widget2.SetActive(false); widget5.SetActive(false); widget.SetActive(true); widget3.SetActive(true); Text component9 = widget.GetComponent <Text>(); component9.set_text(payInfoSet.m_payInfos[j].m_oriValue.ToString()); Text component10 = widget3.GetComponent <Text>(); component10.set_text(payInfoSet.m_payInfos[j].m_payValue.ToString()); Image component11 = widget4.GetComponent <Image>(); component11.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false); } else { widget2.SetActive(false); widget.SetActive(false); widget5.SetActive(false); widget3.SetActive(true); Text component12 = widget3.GetComponent <Text>(); component12.set_text(payInfoSet.m_payInfos[j].m_payValue.ToString()); Image component13 = widget4.GetComponent <Image>(); component13.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false); } break; case CMallItem.OldPriceType.Both: { itemWidget.m_middleOrText.CustomSetActive(true); itemWidget.m_bottomOrText.CustomSetActive(false); widget2.SetActive(false); widget5.SetActive(false); widget.SetActive(true); widget3.SetActive(true); Text component14 = widget.GetComponent <Text>(); component14.set_text(payInfoSet.m_payInfos[j].m_oriValue.ToString()); Text component15 = widget3.GetComponent <Text>(); component15.set_text(payInfoSet.m_payInfos[j].m_payValue.ToString()); Image component16 = widget4.GetComponent <Image>(); component16.SetSprite(CMallSystem.GetPayTypeIconPath(payInfoSet.m_payInfos[j].m_payType), this._giftCenterForm, true, false, false, false); break; } } break; } } return(result); }