private SinglePrize evaMoneyOrRMBPrize(LuckyDrawPrize prize) { SinglePrize p = new SinglePrize(); p.sid = prize.sid; p.uid = prize.uid; p.num = prize.num; p.sourceType = prize.sourceType; p.type = prize.type; return(p); }
private SinglePrize evaOtherPrize(LuckyDrawPrize prize) { SinglePrize p = new SinglePrize(); p.sid = prize.sid; p.uid = prize.uid; p.num = 1; p.sourceType = prize.sourceType; p.type = prize.type; return(p); }
private List <int> getResultIndex() { List <SinglePrize> list = results.getSinglePrizes(); indexList = new List <int> (); int temp = 0; for (int i = 0; i < list.Count; i++) { SinglePrize single = list [i]; for (int j = 0; j < psList.Count; j++) { if (single.type == "money" || single.type == "rmb") { if (changeType(single.type) == psList [j].type) { temp = j; } if (changeType(single.type) == psList [j].type && single.num == psList [j].getPrizeNumByInt()) { indexList.Add(j); break; } else if (j == psList.Count - 1) { indexList.Add(temp); break; } } else { if (single.sid == psList [j].pSid) { temp = j; } if (single.sid == psList [j].pSid && single.num == psList [j].getPrizeNumByInt()) { indexList.Add(j); break; } else if (j == psList.Count - 1) { indexList.Add(temp); break; } } } } return(indexList); }
public List <SinglePrize> getSinglePrizesByQuality(List <SinglePrize> _Oldlist) { if (_Oldlist == null) { return(null); } for (int i = 0; i < _Oldlist.Count; i++) { for (int j = i + 1; j < _Oldlist.Count; j++) { if (_Oldlist [i].type == LuckyDrawPrize.TYPE_CARD) { if (_Oldlist [j].type == LuckyDrawPrize.TYPE_CARD) { Card card_i = StorageManagerment.Instance.getRole(list[i].uid); if (card_i == null) { card_i = CardManagerment.Instance.createCard(list[i].sid); } Card card_j = StorageManagerment.Instance.getRole(list[j].uid); if (card_j == null) { card_j = CardManagerment.Instance.createCard(list[j].sid); } if (card_i != null && card_j != null) { if (card_i.getQualityId() < card_j.getQualityId()) { SinglePrize item = _Oldlist[i]; _Oldlist[i] = _Oldlist[j]; _Oldlist[j] = item; } } } } } } return(_Oldlist); }
//设置创建按钮信息 private void setCreatButton(ButtonPrizeChoose button, SinglePrize prize) { switch (prize.type) { case LuckyDrawPrize.TYPE_CARD: Card card = StorageManagerment.Instance.getRole(prize.uid); if (card == null) { card = CardManagerment.Instance.createCard(prize.sid); } //ResourcesManager.Instance.LoadAssetBundleTexture (ResourcesManager.BACKGROUNDPATH + "backGround_9" , button.buttom); ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.CARDIMAGEPATH + card.getImageID(), button.prizeImage); button.quality.spriteName = QualityManagerment.qualityIDToStringByBG(card.getQualityId()); //add button.nameLabel.text = getQualityColorName(card.getQualityId(), card.getName()); break; case LuckyDrawPrize.TYPE_EQUIP: Equip equip = StorageManagerment.Instance.getEquip(prize.uid); if (equip == null) { equip = EquipManagerment.Instance.createEquip("", prize.sid, 0, 0, 0); } ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + equip.getIconId(), button.prizeImage); // button.quality.spriteName = QualityManagerment.qualityIDToStringByBG (equip.getQualityId ()); //add button.nameLabel.text = equip.getName(); break; default: Prop prop = StorageManagerment.Instance.getProp(prize.sid); if (prop == null) { prop = PropManagerment.Instance.createProp(prize.sid, 1); } ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.ICONIMAGEPATH + prop.getIconId(), button.prizeImage); // button.quality.spriteName = QualityManagerment.qualityIDToStringByBG (prop.getQualityId ()); button.nameLabel.text = prop.getName(); break; } }
//设置展示信息 private void setShowInfo(SinglePrize prize) { switch (prize.type) { case LuckyDrawPrize.TYPE_CARD: confirmButton.transform.position = point2.transform.position; detailButton.transform.position = point1.transform.position; detailButton.gameObject.SetActive(true); Card card = StorageManagerment.Instance.getRole(prize.uid); if (card == null) { card = CardManagerment.Instance.createCard(prize.sid); } number.text = numberShow(prize.type, card.sid); break; case LuckyDrawPrize.TYPE_EQUIP: confirmButton.transform.position = point2.transform.position; detailButton.transform.position = point1.transform.position; detailButton.gameObject.SetActive(true); Equip equip = StorageManagerment.Instance.getEquip(prize.uid); if (equip == null) { equip = EquipManagerment.Instance.createEquip("", prize.sid, 0, 0, 0); } number.text = numberShow(prize.type, equip.sid); break; default: confirmButton.transform.position = point3.transform.position; detailButton.gameObject.SetActive(false); Prop prop = StorageManagerment.Instance.getProp(prize.sid); if (prop == null) { prop = PropManagerment.Instance.createProp(prize.sid, 1); } number.text = numberShow(prize.type, prop.sid); break; } }