public void SetActiveDetail(ActiveShopItem data, ShopItemType _type, int index) { Shop_Index = index; this.ActiveItemdata = data; this._type = _type; SingleType.gameObject.SetActive(true); MultipleType.gameObject.SetActive(false); if (data.disPrice == 0) { SetTagMoneyName(data.mType, data.price, data.pName, mMoney); // if(data.mType == 0) mMoney.text = string.Format(Core.Data.stringManager.getString(20091), colorString +data.price.ToString()+"[-]", Core.Data.stringManager.getString(5037), data.pName); // else if(data.mType == 1) mMoney.text = string.Format(Core.Data.stringManager.getString(20091), colorString + data.price.ToString() + "[-]", Core.Data.stringManager.getString(5070),data.pName); // else mMoney.text = string.Format(Core.Data.stringManager.getString(20091), colorString + data.price.ToString() + "[-]", Core.Data.stringManager.getString(5166),data.pName); } else { SetTagMoneyName(data.mType, data.disPrice, data.pName, mMoney); // if(data.mType == 0) mMoney.text = string.Format(Core.Data.stringManager.getString(20091),colorString+ data.disPrice.ToString()+"[-]", Core.Data.stringManager.getString(5037),data.pName); // else if(data.mType == 1) mMoney.text = string.Format(Core.Data.stringManager.getString(20091), colorString + data.disPrice.ToString()+"[-]", Core.Data.stringManager.getString(5070),data.pName); // else mMoney.text = string.Format(Core.Data.stringManager.getString(20091), colorString + mdata.discount[1].ToString()+"[-]", Core.Data.stringManager.getString(5166),data.pName); } mDescription.text = data.des; mName.text = string.Format(Core.Data.stringManager.getString(20092), data.pName); }
public void SetSecretShopTag(bool key, ActiveShopItem data, ShopItemType _type, int index) { if (_UISecretShopTag == null) { CreateSecretShopTag(); } _UISecretShopTag.gameObject.SetActive(key); _UISecretShopTag.SetActiveDetail(data, _type, index); }
public void OnShow(ActiveShopItem data, ShopItemType mType) { _ItemNum = 1; mActivedata = data; _type = mType; int mCount = 0; SetActiveItemBuyNum(uiLab); if (mType == ShopItemType.Active) { CheckCanBuy(mActivedata.yetBuyCount, mActivedata.buyCount); } while (mCount < data.pStar) { if (mStars[mCount] != null) { mStars[mCount].gameObject.SetActive(true); } mStars[mCount].transform.localPosition = new Vector3(m1.x + (mCount + 1) * 2 * mm, m1.y, m1.z); mCount++; } for (int j = 0; j < mCount; j++) { mStars[j].transform.localPosition = new Vector3(mStars[j].transform.localPosition.x - (mCount + 1) * mm, m1.y, m1.z);; } for (; mCount < 5; mCount++) { if (mStars[mCount] != null) { mStars[mCount].gameObject.SetActive(false); } } if (mItemName != null) { mItemName.text = data.pName; } if (mIconContent != null) { ; // string _str = data.des; // _str += string.Format(Core.Data.stringManager.getString(25169), data.yetBuyCount.ToString(), data.buyCount.ToString()); // mIconContent.text = _str; } if (mItemIcon != null) { UIAtlas _atlas = UIDragonMallMgr.GetInstance().GetActiveAtlas(data.iconId); if (_atlas != null) { mItemIcon.atlas = _atlas; mItemIcon.spriteName = data.iconId; } } if (data.disPrice == 0) { if (mSalePrice != null) { mSalePrice.text = data.price.ToString(); } if (mPrice != null) { mPrice.gameObject.SetActive(false); } if (mMoneyIcon != null) { mMoneyIcon.gameObject.SetActive(false); } if (mCoinIcon != null) { mCoinIcon.gameObject.SetActive(false); } if (mIsSaleIcon != null) { mIsSaleIcon.alpha = 0f; } if (mSaleBgIcon != null) { mSaleBgIcon.alpha = 0f; } if (mMoneyIconBG != null) { mMoneyIconBG.gameObject.SetActive(false); } if (mSaleLineIcon != null) { mSaleLineIcon.gameObject.SetActive(false); } if (data.mType == 0) { mSaleMoneyIcon.gameObject.SetActive(false); mSaleCoinIcon.gameObject.SetActive(true); mSaleSoulIcon.gameObject.SetActive(false); } else if (data.mType == 1) { mSaleMoneyIcon.gameObject.SetActive(true); mSaleCoinIcon.gameObject.SetActive(false); mSaleSoulIcon.gameObject.SetActive(false); } else { mSaleMoneyIcon.gameObject.SetActive(false); mSaleCoinIcon.gameObject.SetActive(false); mSaleSoulIcon.gameObject.SetActive(true); if (data.mType == 2) { mSaleSoulIcon.atlas = AtlasMgr.mInstance.commonAtlas; mSaleSoulIcon.spriteName = "jifen"; } else if (data.mType == 3) { mSaleSoulIcon.atlas = AtlasMgr.mInstance.commonAtlas; mSaleSoulIcon.spriteName = "common-0077"; } else { GetMarkAtlasAndSet(data.mType, mSaleSoulIcon); mSaleSoulIcon.gameObject.SetActive(true); } } } else { if (mPrice != null) { mPrice.text = data.disPrice.ToString(); } mPrice.gameObject.SetActive(true); if (mSalePrice != null) { mSalePrice.text = data.price.ToString(); } if (mIsSaleIcon != null) { mIsSaleIcon.alpha = 1f; } if (mSaleBgIcon != null) { mSaleBgIcon.alpha = 1f; } if (data.mType == 0) { if (mMoneyIcon != null) { mMoneyIcon.gameObject.SetActive(false); } if (mCoinIcon != null) { mCoinIcon.gameObject.SetActive(true); } if (mSaleMoneyIcon != null) { mSaleMoneyIcon.gameObject.SetActive(false); } if (mSaleCoinIcon != null) { mSaleCoinIcon.gameObject.SetActive(true); } if (mSaleSoulIcon != null) { mSaleSoulIcon.gameObject.SetActive(false); } } else if (data.mType == 1) { if (mMoneyIcon != null) { mMoneyIcon.gameObject.SetActive(true); } if (mCoinIcon != null) { mCoinIcon.gameObject.SetActive(false); } if (mSaleMoneyIcon != null) { mSaleMoneyIcon.gameObject.SetActive(true); } if (mSaleCoinIcon != null) { mSaleCoinIcon.gameObject.SetActive(false); } if (mSaleSoulIcon != null) { mSaleSoulIcon.gameObject.SetActive(false); } } else { if (mMoneyIcon != null) { mMoneyIcon.gameObject.SetActive(false); } if (mCoinIcon != null) { mCoinIcon.gameObject.SetActive(false); } if (mSaleMoneyIcon != null) { mSaleMoneyIcon.gameObject.SetActive(false); } if (mSaleCoinIcon != null) { mSaleCoinIcon.gameObject.SetActive(false); } mSaleSoulIcon.gameObject.SetActive(true); if (data.mType == 2) { mSaleSoulIcon.atlas = AtlasMgr.mInstance.commonAtlas; mSaleSoulIcon.spriteName = "jifen"; } else if (data.mType == 3) { mSaleSoulIcon.atlas = AtlasMgr.mInstance.commonAtlas; mSaleSoulIcon.spriteName = "common-0077"; } else { GetMarkAtlasAndSet(data.mType, mSaleSoulIcon); mSaleSoulIcon.gameObject.SetActive(true); } } if (mMoneyIconBG != null) { mMoneyIconBG.gameObject.SetActive(true); } if (mSaleLineIcon != null) { mSaleLineIcon.gameObject.SetActive(true); } } gameObject.SetActive(true); }