//0道具,1装备,2卡片.3神器 private GameObject CreateGoodsItem(int sid, int count, int type) { GameObject obj = Instantiate(goodsViewPrefab) as GameObject; obj.transform.localScale = new Vector3(0.7f, 0.7f, 1); GoodsView view = obj.transform.GetComponent <GoodsView> (); view.linkQualityEffectPoint(); view.fatherWindow = this; if (type == 0) { Prop p = PropManagerment.Instance.createProp(sid, count); view.init(p); } else if (type == 1) { Equip e = EquipManagerment.Instance.createEquip(sid); view.init(e); view.onClickCallback = () => { UiManager.Instance.openWindow <EquipAttrWindow> ((winEquip) => { winEquip.Initialize(e, EquipAttrWindow.OTHER, null); }); }; } else if (type == 2) { Card c = CardManagerment.Instance.createCard(sid); view.init(c); view.onClickCallback = () => { CardBookWindow.Show(c, CardBookWindow.SHOW, null); }; } else if (type == 3) { MagicWeapon mc = MagicWeaponManagerment.Instance.createMagicWeapon(sid); view.init(mc); view.onClickCallback = () => { hideWindow(); UiManager.Instance.openWindow <MagicWeaponStrengWindow>((win) => { win.init(mc, MagicWeaponType.FORM_OTHER); }); }; } return(obj); }
//* 更新Goods显示 */ public void UpdateGoodsView() { GameObject obj; if (roleViewPoint.transform.childCount > 0) { obj = roleViewPoint.transform.GetChild(0).gameObject; } else { obj = NGUITools.AddChild(roleViewPoint, goodsViewPrefab); obj.transform.localScale = new Vector3(0.85f, 0.85f, 1); } GoodsView gv = obj.GetComponent <GoodsView>(); gv.setFatherWindow(this.win); //gv.init(starSoul); }
void OnButtonClick(GoodsView view) { if (window.isSelect(view.equip)) { window.offSelectEquip(view.equip); view.tempGameObj.SetActive(false); } else if (window.selectMagicList.Count + window.selectedCardList.Count + window.selectedEquipList.Count < 8) { window.onSelectEquip(view.equip); view.tempGameObj.SetActive(true); } else if (window.selectMagicList.Count + window.selectedCardList.Count + window.selectedEquipList.Count >= 8) { TextTipWindow.ShowNotUnlock(Language("resolveChooseMax_2")); } MaskWindow.UnlockUI(); }
/// <summary> /// 更新星魂形象 /// </summary> private void updateStarSoulView() { GameObject obj; if (starSoulIconPoint.transform.childCount > 0) { obj = starSoulIconPoint.transform.GetChild(0).gameObject; } else { obj = NGUITools.AddChild(starSoulIconPoint, starSoulViewsPerfab); obj.transform.localScale = new Vector3(0.85f, 0.85f, 1); } GoodsView gv = obj.GetComponent <GoodsView>(); gv.setFatherWindow(fatherWindow); gv.init(starSoul); }
public ListGoodsViewModel(GoodsView model) { Id = model.Id; Name = model.Name; OriginalPrice = model.OriginalPrice; ShopPrice = model.ShopPrice; SalesVolume = model.SalesVolume; PaymentAmount = model.PaymentAmount; var fileService = HostConstObject.Container.Resolve <IStorageFileService>(); var mainImage = fileService.GetFiles(model.Id, MallModule.Key, "MainImage").FirstOrDefault(); MainImage = mainImage?.Simplified(); IsGroupon = model.IsGroupon; GrouponPrice = model.GrouponPrice; GrouponStartTime = model.GrouponStartTime; GrouponEndTime = model.GrouponEndTime; IsPresell = model.IsPresell; }
/** 更新UI */ public void UpdateIU() { UpdateButton(); GameObject obj; if (goodsViewPoint.transform.childCount > 0) { obj = goodsViewPoint.transform.GetChild(0).gameObject; } else { obj = NGUITools.AddChild(goodsViewPoint, goodsViewPrefab); obj.transform.localScale = new Vector3(0.85f, 0.85f, 1); } GoodsView gv = obj.GetComponent <GoodsView>(); gv.setFatherWindow(fatherWindow); gv.init(starSoul); //starSoulLev.text = QualityManagerment.getQualityColor(starSoul.getQualityId()) + starSoul.getName () + " Lv." + starSoul.getLevel (); //清空属性内容 infoLabel.text = ""; infoLabel1.text = ""; starSoulLev.text = starSoul.getName() + " Lv." + starSoul.getLevel(); string[] str = starSoul.getDescribe().Split('#'); if (str.Length > 1) { infoLabel.text = "[A65644]" + str[0].Replace("+", "[3A9663]+"); infoLabel1.text = "[A65644]" + str[1].Replace("+", "[3A9663]+"); } else { infoLabel1.text = "[A65644]" + str[0].Replace("+", "[3A9663]+"); } bool isPutOn = starSoul.checkState(EquipStateType.OCCUPY); if (isPutOn) { state.text = LanguageConfigManager.Instance.getLanguage("s0017"); } else { state.text = ""; } }
/// <summary> /// 创建星魂条目 /// </summary> /// <param name="starSoul">星魂</param> private GameObject CreateStarSoulItem(int sid) { if (goodsPoint.transform.childCount == 0) { StarSoul starSoul = StarSoulManager.Instance.createStarSoul(sid); GameObject obj = NGUITools.AddChild(goodsPoint, goodsViewProfab) as GameObject; GoodsView view = obj.transform.GetComponent <GoodsView> (); view.init(starSoul, GoodsView.BOTTOM_TEXT_NAME); view.fatherWindow = fatherWindow; view.onClickCallback = () => { UiManager.Instance.openDialogWindow <StarSoulAttrWindow> ( (win) => { win.Initialize(starSoul, StarSoulAttrWindow.AttrWindowType.None); }); }; return(obj); } return(null); }
/// <summary> /// 创建奖励条目 /// </summary> /// <param name="prizeSample">模板装备</param> private GameObject CreateAwardItem(PrizeSample prizeSample) { GameObject gameObject; if (prizeSample.type == PrizeType.PRIZE_CARD) { GameObject obj = Instantiate(goodsViewPrefab) as GameObject; GoodsView role = obj.GetComponent <GoodsView> (); role.fatherWindow = this; role.init(CardManagerment.Instance.createCard(prizeSample.pSid)); role.rightBottomText.gameObject.SetActive(false); gameObject = role.gameObject; gameObject.SetActive(false); } else if (prizeSample.type == PrizeType.PRIZE_EQUIPMENT) { GameObject obj = Instantiate(goodsViewPrefab) as GameObject; GoodsView goods = obj.GetComponent <GoodsView> (); goods.fatherWindow = this; goods.init(EquipManagerment.Instance.createEquip(prizeSample.pSid)); gameObject = goods.gameObject; gameObject.SetActive(false); } else if (prizeSample.type == PrizeType.PRIZE_MERIT) { GameObject obj = Instantiate(goodsViewPrefab) as GameObject; GoodsView goods = obj.GetComponent <GoodsView>(); goods.fatherWindow = this; goods.init(prizeSample); gameObject = goods.gameObject; gameObject.SetActive(false); } else { GameObject obj = Instantiate(goodsViewPrefab) as GameObject; GoodsView goods = obj.GetComponent <GoodsView> (); goods.fatherWindow = this; goods.init(PropManagerment.Instance.createProp(prizeSample.pSid)); gameObject = goods.gameObject; gameObject.SetActive(false); } return(gameObject); }
public void SetData(HappySundaySample baseData, WindowBase faterWindow) { mBaseData = baseData; int currentScore = Mathf.Min(baseData.MaxScore, HappySundayManagerment.Instance.CurrentScore); UI_TitleLabel.text = string.Format(LanguageConfigManager.Instance.getLanguage("s0564"), "[ffcc00]" + baseData.MaxScore + "[-]"); UI_Progress.value = (float)currentScore / (float)baseData.MaxScore; UI_ProgressLabel.text = currentScore + "/" + baseData.MaxScore; for (int i = 0; i < baseData.AwardGoods.Length; i++) { GoodsView goods = NGUITools.AddChild(UI_GoodsContainer.gameObject, UI_GoodsTemplate.gameObject).GetComponent <GoodsView>(); goods.init(baseData.AwardGoods[i].type, baseData.AwardGoods[i].sid, baseData.AwardGoods[i].num); goods.fatherWindow = faterWindow; } UI_GoodsContainer.GetComponent <UIGrid>().Reposition(); updateReceiveBtn(); }
/// <summary> /// 初始化 宝箱中的奖励 /// </summary> /// <param name="chestInfo">Chest info.</param> /// <param name="_prizes">_prizes.</param> public void initAward(LaddersChestInfo chestInfo, PrizeSample[] _prizes) { this.prizes = _prizes; if (prizes != null && prizes.Length > 0) { for (int i = 0; i < prizes.Length; i++) { GameObject a = NGUITools.AddChild(gridContent.gameObject, goodsViewPrefab); a.name = StringKit.intToFixString(i + 1); GoodsView goodsButton = a.GetComponent <GoodsView> (); goodsButton.fatherWindow = this; goodsButton.onClickCallback = goodsButton.DefaultClickEvent; goodsButton.init(prizes[i]); } gridContent.repositionNow = true; } data = chestInfo; btn_receive.disableButton(!data.receiveEnble); updateChestName(); }
/// <summary> /// 初始化card /// </summary> public void loadCards() { if (info == null) { return; } for (int i = 0; i < info.cardSids.Count; i++) { GameObject go = NGUITools.AddChild(cards[i], itemPrefab); if (info.cardSids[i].StartsWith("0")) { continue; } string[] sidorlv = info.cardSids[i].Split(':'); Card card = CardManagerment.Instance.createCard(StringKit.toInt(sidorlv[0]), StringKit.toInt(sidorlv[1]), StringKit.toInt(sidorlv[2])); GoodsView item = go.GetComponent <GoodsView>(); item.init(card); item.rightBottomText.gameObject.SetActive(false); } }
/// <summary> /// 初始化奖励信息 /// </summary> public void initAward() { PrizeSample[] tmpList = mission.getPrizes(); Equip tmpEquip = null; if (tmpPrize == null) { for (int i = 0; i < tmpList.Length; i++) { if (tmpList [i].type == PrizeType.PRIZE_EQUIPMENT) { tmpEquip = EquipManagerment.Instance.createEquip(tmpList [i].pSid); if (tmpEquip != null && !tmpEquip.isToEat()) { if (getEquipPrizeSid(tmpEquip) != -1) { tmpPrize = new PrizeSample(3, getEquipPrizeSid(tmpEquip), 1); } break; } else { continue; } } } if (tmpPrize != null && goodView == null) { GameObject item = NGUITools.AddChild(goodsViewPos, goodsViewPrefab); GoodsView button = item.GetComponent <GoodsView> (); button.fatherWindow = fatherWindow; button.onClickCallback = () => { DoClickEvent(); }; button.init(tmpPrize); button.rightBottomText.text = ""; goodView = button; } } awardDisplay(); }
//最原始的初始化 public void init(object obj, int numberMax, int numberMin, int numberNow, int numberSetp, CallBackMsg callback) { msg = new MessageHandle(); msg.msgInfo = obj; item = obj as Prop; this.callback = callback; setp = numberSetp; max = numberMax; min = numberMin; now = numberNow; coverDistanceToOne(); updateGetNum(); updateDisplayeNumber(); calculateTotal(); GoodsView tmpGoodsView = CreateGoodsView(); currentHaveNum.text = numberMax.ToString(); tmpGoodsView.init(item); tmpGoodsView.rightBottomText.text = ""; titleText.text = item.getName(); }
public void init(GuildFightAwardSample sample) { int pos = 0; title.text = sample.name; Utils.DestoryChilds(content.gameObject); for (int i = 0; i < sample.prizes.Length; i++) { PrizeSample ps = sample.prizes[i]; if (ps.type != PrizeType.PRIZE_CARD) { GameObject obj = NGUITools.AddChild(content.gameObject, goodViewPrefab); GoodsView sc = obj.GetComponent <GoodsView>(); sc.fatherWindow = fatherWindow; sc.init(ps); obj.transform.localScale = new Vector3(0.95f, 0.95f, 1); obj.transform.localPosition = new Vector3(pos * 110 - 20, 0, 0); pos++; } } }
public void initItem(LastBattleDonationSample _itemData) { itemData = _itemData; if (itemData != null) { juGongValue.text = "X" + itemData.junGong.ToString(); nvShenBlessValue.text = "lv+" + itemData.nvShenBlessLV.ToString(); processValue.text = "+" + itemData.process.ToString(); scoreValue.text = "+" + itemData.scores.ToString(); updateDonateButtonState(itemData); setGoodsTittle(itemData); GameObject obj = GameObject.Instantiate(goodsTmp.gameObject) as GameObject; GoodsView view = obj.GetComponent <GoodsView>(); obj.transform.parent = this.transform; obj.transform.localPosition = goodsPos.localPosition; obj.transform.localScale = Vector3.one; view.init(itemData.donation); view.rightBottomText.gameObject.SetActive(false); view.fatherWindow = fartherWin; } }
public void initGoodsInfoPanel(LastBattleDonationSample itemData, LastBattleDonateItem item) { if (itemData != null) { donateItem = item; sample = itemData; obj = GameObject.Instantiate(goodsTmp.gameObject) as GameObject; view = obj.GetComponent <GoodsView>(); trans = obj.transform; view.init(itemData.donation); view.rightBottomText.gameObject.SetActive(false); view.fatherWindow = this; trans.parent = goodsPos.parent; trans.localPosition = goodsPos.localPosition; trans.localScale = Vector3.one; goodsInfoPanel.SetActive(true); haveCount.text = LastBattleManagement.Instance.getHaveGoodsCount(itemData); donateCount.text = itemData.donation.num; } }
/// <summary> /// 拾取星魂特效 /// </summary> /// <param name="nodeNames">播放特效的节点名列表</param> /// <param name="targetGameObj">飞行目标对象</param> /// <param name="callback">特效完后回调</param> IEnumerator playPopStoreEffect(GameObject[] nodeObjs, GameObject targetGameObj, CallBack callback) { if (nodeObjs != null) { Vector3 moveToPos = new Vector3(0, -0.1f, 0); GameObject childGameObj; EffectManager effectManager = EffectManager.Instance; for (int i = 0; i < nodeObjs.Length; i++) { childGameObj = nodeObjs[i]; if (childGameObj == null) { continue; } GameObject flyItem = NGUITools.AddChild(flyContentPoint, flyItemPrefab) as GameObject; FlyCtrl flyCtrl = flyItem.GetComponent <FlyCtrl>(); GoodsView view = childGameObj.GetComponent <GoodsView> (); effectManager.CreateEffect(childGameObj.transform, "Effect/UiEffect/SummonBeast2"); flyCtrl.gameObject.transform.position = childGameObj.transform.position; flyCtrl.gameObject.SetActive(true); flyCtrl.Initialize(view.gameObject, moveToPos, targetGameObj); flyCtrl.overCallBack = (callTargetGameObj) => { if (callTargetGameObj.transform.childCount == 0) { effectManager.CreateEffect(callTargetGameObj.transform, "Effect/UiEffect/WeakFlare"); } }; GameObject.Destroy(childGameObj); view.clean(); } yield return(new WaitForSeconds(1.4f)); } if (callback != null) { callback(); callback = null; } }
/** 更新积分条目 */ private void updateSource(RankAward tl) { resetSprite(); if (!tl.isAward) { uncomplate.SetActive(true); } else { complated.SetActive(true); } sourceNum.text = tl.needSource.ToString(); Utils.DestoryChilds(content.gameObject); for (int i = 0; i < tl.prizes.Length; i++) { PrizeSample ps = tl.prizes[i]; GameObject obj = NGUITools.AddChild(content.gameObject, goodsViewPrefab); GoodsView sc = obj.GetComponent <GoodsView>(); sc.init(ps); sc.fatherWindow = winn; content.GetComponent <UIGrid>().repositionNow = true; } }
/** 创建奖励对象 */ private void CreateGoodsByAward(List <GameObject> awards, Award aw) { if (aw != null) { List <PrizeSample> awardListt = AllAwardViewManagerment.Instance.exchangeAwardToPrize(aw); if (awardListt != null && awardListt.Count > 0) { int nameIndex = 0; for (int i = 0; i < awardListt.Count; i++) { nameIndex++; GameObject obj = NGUITools.AddChild(awardContent, goodsViewPrefab) as GameObject; obj.SetActive(false); GoodsView view = obj.transform.GetComponent <GoodsView> (); view.linkQualityEffectPoint(); view.fatherWindow = this; view.init(awardListt[i]); obj.name = "goodsbutton_" + nameIndex; awardList.Add(obj); } } } }
public IActionResult Edit(GoodsView model) { if (model.Id > 0) // если есть Id, то редактируем модель { var dbItem = _goodsService.GetById(model.Id); if (ReferenceEquals(dbItem, null)) { return(NotFound());// возвращаем результат 404 Not Found } dbItem.Description = model.Description; dbItem.EAN13 = model.EAN13; dbItem.Group = model.Group; dbItem.Price = model.Price; } else // иначе добавляем модель в список { _goodsService.Add(model); } _goodsService.SaveChanges(); // станет актуальным позднее (когда добавим БД) return(RedirectToAction(nameof(Index))); }
/// <summary> /// 根据分拣账号查询信息 /// </summary> /// <param name="FJ_id">分拣账号</param> /// <param name="UserName">分拣人姓名</param> /// <returns></returns> public GoodsView searcheGoods(string FJ_id, string UserName) { string ConnString = ConfigurationManager.AppSettings["Sngoo"]; GoodsView consequence = new GoodsView(); string ConnQuery = "select " + "*" + " from " + "fj_GoodsInfo" + " where " + "FJ_id" + "='" + FJ_id + "'" + "and UserName='******'"; SqlConnection connection = new SqlConnection(ConnString); connection.Open(); SqlCommand lo_cmd = new SqlCommand(ConnQuery, connection); SqlDataReader reader = lo_cmd.ExecuteReader(); reader.Read(); if (reader.HasRows) { consequence.DrugCode = reader["DrugCode"].ToString(); consequence.DrugName = reader["DrugName"].ToString(); consequence.DrugPrice = Convert.ToDecimal(reader["DrugPrice"]); consequence.DrugWeight = Convert.ToDecimal(reader["DrugWeight"]); consequence.FJ_id = reader["FJ_id"].ToString(); consequence.FJ_time = Convert.ToDateTime(reader["FJ_time"]); consequence.packed = Convert.ToInt32(reader["Packed"]); consequence.TotalPrice = Convert.ToDecimal(reader["TotalPrice"]); consequence.UserName = reader["UserName"].ToString(); consequence.UserTel = reader["UserTel"].ToString(); consequence.PuzzlePrice = Convert.ToDecimal(reader["PuzzlePrice"]); consequence.PuzzleTotlePrice = Convert.ToDecimal(reader["PuzzleTotlePrice"]); consequence.Units = reader["Units"].ToString(); } else { consequence = null; } reader.Close(); connection.Close(); connection.Dispose(); return(consequence); }
/// <summary> /// 更新排行条目 /// </summary> /// <param name="tl">Tl.</param> private void updateRank(RankAward tl) { if (tl.rinkNum == 1) { rinkNum.gameObject.SetActive(false); firstAwardLogo.gameObject.SetActive(true); } else { rinkNum.gameObject.SetActive(true); firstAwardLogo.gameObject.SetActive(false); rinkNum.text = tl.dec; } Utils.DestoryChilds(content.gameObject); for (int i = 0; i < tl.prizes.Length; i++) { PrizeSample ps = tl.prizes[i]; GameObject obj = NGUITools.AddChild(content.gameObject, goodsViewPrefab); GoodsView sc = obj.GetComponent <GoodsView>(); sc.init(ps); sc.fatherWindow = winn; content.GetComponent <UIGrid>().repositionNow = true; } }
protected override void RefreshGameObjs() { base.RefreshGameObjs(); SetGameObjCountEquleList(data.wallList.Count, wallLines, prefabs.GetNewInstance_grey); SetGameObjCountEquleList(data.wallList.Count, wallsideLines, prefabs.GetNewInstance_black, 2); SetGameObjCountEquleList(data.wallList.Count, wallEndLines, prefabs.GetNewInstance_black, 2); SetGameObjCountEquleList(data.pointList.Count, wallPoints, prefabs.GetNewInstance_point); SetGameObjCountEquleList(data.wallList.Count, showLenLines, prefabs.GetNewInstance_line, 2); SetGameObjCountEquleList(data.wallList.Count, showLenPoints, prefabs.GetNewInstance_fork, 4); SetGameObjCountEquleList(data.wallList.Count, showWords, prefabs.GetNewInstance_text, 2); SetGameObjCountEquleList(data.roomList.Count, floors, prefabs.GetNewInstance_floor); SetGameObjCountEquleList(data.roomList.Count, areas, prefabs.GetNewInstance_area); SetGameObjCountEquleList(selectPackedProductdatas.Count, selectPackedproducts, prefabs.GetNewInstance_selectGoods); for (int i = 0; i < showLenLines.Count; i++) { showLenLines[i].gameObject.SetActive(false); } for (int i = 0; i < showLenPoints.Count; i++) { showLenPoints[i].gameObject.SetActive(false); } for (int i = 0; i < showWords.Count; i++) { showWords[i].gameObject.SetActive(false); } for (int i = 0; i < data.productDataList.Count; i++) { int id = data.productDataList[i].id; if (products.ContainsKey(id) == false) { products.Add(id, new List <GameObject>()); } } goodsViewList.Clear(); removeListId.Clear(); foreach (int id in products.Keys) { hasIndexList.Clear(); for (int i = 0; i < data.productDataList.Count; i++) { ProductData productData = data.productDataList[i]; if (productData.id == id) { hasIndexList.Add(i); if (products.ContainsKey(id) && products[id].Count >= hasIndexList.Count) { GameObject go = products[id][hasIndexList.Count - 1]; Vector3 size = mainPageData.getProduct(productData.seekId).size; GoodsVO vo = mainPageData.getGoods(productData.seekId); ResourcesPool.DisposTexture(go); SetTextureTool.SetTexture(go, vo.uri2D, vo.seekId); Product product = mainPageData.getProduct(vo.seekId); float y = productData.height; switch (productData.type) { case 2: //门窗 { //if (product.entityType == "window") //{ // y = 1; //} } break; case 3: //吊顶 { if (product == null) { break; } y = defaultSetting.DefaultHeight + productData.height - product.size.y; } break; case 4: //地毯 { y = productData.height + -0.001f; } break; case 5: //天花板 { y = defaultSetting.DefaultHeight + productData.height - 0.001f; } break; case 6: //吸附各个平面 暂时不做 { //world3d.y = defaultSetting.DefaultHeight - 0.01f; } break; default: //不吸附 break; } productData.setData(go, size, y, true); GoodsView goodsView = go.GetComponent <GoodsView>(); goodsView.SetData(productData); if (selectObjData == productData) { if (selectGoods == null) { selectGoods = prefabs.GetNewInstance_selectGoods().gameObject; } selectGoods.transform.localRotation = go.transform.localRotation; selectGoods.transform.localScale = go.transform.localScale; selectGoods.transform.localPosition = go.transform.localPosition - Vector3.forward; selectGoods.SetActive(true); if (productData.hide == true) { selectGoods.SetActive(false); } } for (int k = 0; k < selectPackedProductdatas.Count; k++) { if (selectPackedProductdatas[k] == productData) { GameObject obj = selectPackedproducts[k]; //if (obj == null) obj = prefabs.GetNewInstance_selectGoods().gameObject; obj.transform.localRotation = go.transform.localRotation; obj.transform.localScale = go.transform.localScale; obj.transform.localPosition = go.transform.localPosition - Vector3.forward; obj.SetActive(true); if (productData.hide == true) { obj.SetActive(false); } break; } } if (productData.hide == true) { go.SetActive(false); } else { go.SetActive(true); } goodsViewList.Add(goodsView); } } } int minCount = hasIndexList.Count < products[id].Count ? hasIndexList.Count : products[id].Count; for (int i = minCount; i < products[id].Count; i++) { GameObject.DestroyImmediate(products[id][i], true); products[id].RemoveAt(i); i--; } for (int i = minCount; i < hasIndexList.Count; i++) { int index = hasIndexList[i]; ProductData product = data.productDataList[index]; LoadMode(product); } if (products[id].Count == 0) { removeListId.Add(id); } } if ((selectObjData == null || selectObjData is ProductData == false) && selectGoods != null) { selectGoods.SetActive(false); } for (int i = 0; i < removeListId.Count; i++) { products.Remove(removeListId[i]); } if (inputWallLengths.Count == 0) { for (int i = 0; i < 5; i++) { GameObject go = prefabs.GetNewInstance_inputWallLength().gameObject; go.AddComponent <SetLengthHandleView>(); go.SetActive(false); inputWallLengths.Add(go); } } }
public void init(GodsWarPrizeSample info, int index, WindowBase win) { this.info = info; this.win = win; bool canReceived = false; lblCondition.text = ""; completedIcon.SetActive(false); bg01.gameObject.SetActive(false); firstAwardLogo.gameObject.SetActive(false); title.gameObject.SetActive(false); lblName.text = info.des; lblName.effectStyle = UILabel.Effect.Outline; lblName.effectColor = new Color(33f / 255, 59f / 255, 87f / 255); lblName.transform.localPosition = new Vector3(0, 86, 0); string currentState = GodsWarManagerment.Instance.getGodsWarStateInfo(); if (currentState.EndsWith("zige_group")) { if (index == 0) { firstAwardLogo.gameObject.SetActive(true); title.gameObject.SetActive(false); lblName.gameObject.SetActive(false); } else { firstAwardLogo.gameObject.SetActive(false); title.gameObject.SetActive(true); lblName.gameObject.SetActive(true); lblName.gameObject.transform.localPosition = new Vector3(0, lblName.gameObject.transform.localPosition.y, lblName.gameObject.transform.localPosition.z); } } else if (currentState.EndsWith("zige_final") || currentState.EndsWith("zige_taotai")) { firstAwardLogo.gameObject.SetActive(true); firstAwardLogo.spriteName = "medal_" + (index + 1); if (index > 3) { firstAwardLogo.spriteName = "medal_4"; } title.gameObject.SetActive(false); lblName.gameObject.SetActive(true); lblName.gameObject.transform.localPosition = new Vector3(0, lblName.gameObject.transform.localPosition.y - 10, lblName.gameObject.transform.localPosition.z); } int pos = 0; Utils.DestoryChilds(content.gameObject); for (int i = 0; i < info.item.Count; i++) { PrizeSample ps = info.item [i]; if (win is GodsWarFinalRankWindow) { GameObject obj = NGUITools.AddChild(content.gameObject, (win as GodsWarFinalRankWindow).goodsViewPrefab); GoodsView sc = obj.GetComponent <GoodsView> (); sc.init(ps); sc.fatherWindow = win; obj.transform.localScale = new Vector3(0.9f, 0.9f, 1); obj.transform.localPosition = new Vector3(pos * 100 - 10, 0, 0); pos++; } if (win is GodsWarIntegralRankAwardWindow) { GameObject obj = NGUITools.AddChild(content.gameObject, (win as GodsWarIntegralRankAwardWindow).goodsViewPrefab); GoodsView sc = obj.GetComponent <GoodsView> (); sc.init(ps); sc.fatherWindow = win; obj.transform.localScale = new Vector3(0.95f, 0.95f, 1); obj.transform.localPosition = new Vector3(pos * 110 - 20, 0, 0); pos++; } } }
/// <summary> /// 读取分拣订单信息 /// </summary> /// <param name="StarTime">开始时间</param> /// <param name="EndTime">结束时间</param> /// <returns></returns> public List <GoodsView> readFJINFO(string StarTime, string EndTime, string Username) { string ConnString = ConfigurationManager.AppSettings["Sngoo"]; List <GoodsView> cacheRead = new List <GoodsView>(); string ConnQuery = "select * from fj_GoodsInfo where FJ_time between'" + StarTime + "' and'" + EndTime + "'" + "and UserName='******'"; SqlConnection connection = new SqlConnection(ConnString); connection.Open(); SqlCommand lo_cmd = new SqlCommand(ConnQuery, connection); SqlDataReader reader = lo_cmd.ExecuteReader(); if (!reader.HasRows) //读取的行数 { cacheRead = null; } else { while (reader.Read()) { GoodsView cacheItem = new GoodsView(); cacheItem.DrugCode = reader["DrugCode"].ToString(); cacheItem.DrugName = reader["DrugName"].ToString(); cacheItem.DrugWeight = Convert.ToDecimal(reader["DrugWeight"]); cacheItem.FJ_id = reader["FJ_id"].ToString(); cacheItem.FJ_time = Convert.ToDateTime(reader["FJ_time"]); cacheItem.packed = Convert.ToInt32(reader["Packed"]); cacheItem.UserName = reader["UserName"].ToString(); cacheItem.UserTel = reader["UserTel"].ToString(); if (reader["DrugPrice"].ToString() != "") { cacheItem.DrugPrice = Convert.ToDecimal(reader["DrugPrice"]); } else { cacheItem.DrugPrice = 0; } if (reader["TotalPrice"].ToString() != "") { cacheItem.TotalPrice = Convert.ToDecimal(reader["TotalPrice"]); } else { cacheItem.TotalPrice = 0; } if (reader["PuzzlePrice"].ToString() != "") { cacheItem.PuzzlePrice = 0; } else { cacheItem.PuzzlePrice = Convert.ToDecimal(reader["PuzzlePrice"]); } if (reader["PuzzleTotlePrice"].ToString() != "") { cacheItem.PuzzleTotlePrice = 0; } else { cacheItem.PuzzleTotlePrice = Convert.ToDecimal(reader["PuzzleTotlePrice"]); } if (reader["Units"] == DBNull.Value) { cacheItem.Units = "斤"; } else { cacheItem.Units = reader["Units"].ToString(); } cacheRead.Add(cacheItem); } } reader.Close(); connection.Close(); connection.Dispose(); return(cacheRead); }
public void init(ArenaAwardInfo info) { this.info = info; bool canReceived = false; lblCondition.text = ""; completedIcon.SetActive(false); bg01.gameObject.SetActive(false); // bg02.gameObject.SetActive (false); firstAwardLogo.gameObject.SetActive(false); title.gameObject.SetActive(false); /** 决赛奖励 */ if (info.sample.type == ArenaAwardWindow.TYPE_FINAL) { lblName.text = "[FFF0C1]" + info.sample.name; lblName.effectStyle = UILabel.Effect.Outline; lblName.effectColor = new Color(33f / 255, 59f / 255, 87f / 255); lblName.transform.localPosition = new Vector3(0, 86, 0); buttonConfirm.gameObject.SetActive(false); if (info.sample.type == ArenaAwardSample.TYPE_FINAL) { if (info.sample.condition == ArenaAwardSample.CONDITION_TYPE) { // bg00.spriteName = "img_7"; // bg02.gameObject.SetActive(true); firstAwardLogo.gameObject.SetActive(true); lblName.gameObject.SetActive(true); title.gameObject.SetActive(false); lblName.gameObject.SetActive(false); } else { firstAwardLogo.gameObject.SetActive(false); title.gameObject.SetActive(true); lblName.gameObject.SetActive(true); lblName.gameObject.transform.localPosition = new Vector3(0, lblName.gameObject.transform.localPosition.y, lblName.gameObject.transform.localPosition.z); } } } /** 竞猜奖励 */ else if (info.sample.type == ArenaAwardWindow.TYPE_GUESS) { lblName.transform.localPosition = new Vector3(0, 60, 0); lblName.text = "[A93D12]" + info.sample.name + "[-]"; content.transform.localPosition = new Vector3(-196, -25, -300); buttonConfirm.transform.localPosition = new Vector3(180, -20, 0); bg01.gameObject.SetActive(true); canReceived = info.condition > 0; lblCondition.text = LanguageConfigManager.Instance.getLanguage("Arena33", info.condition.ToString()); } /** 积分奖励 */ else { lblName.transform.localPosition = new Vector3(-27, 0, 0); lblName.text = "[6E473D]" + info.sample.name + "[-]"; content.transform.localPosition = new Vector3(-196, -5, -300); buttonConfirm.transform.localPosition = new Vector3(180, -5, 0); completedIcon.SetActive(info.received); buttonConfirm.gameObject.SetActive(!info.received); canReceived = info.condition >= info.sample.condition; } if (canReceived && !info.received) { buttonConfirm.disableButton(false); } else { buttonConfirm.disableButton(true); } int pos = 0; Utils.DestoryChilds(content.gameObject); for (int i = 0; i < info.sample.prizes.Length; i++) { PrizeSample ps = info.sample.prizes[i]; // if(ps.type != PrizeType.PRIZE_CARD) // { GameObject obj = NGUITools.AddChild(content.gameObject, window.goodsViewPrefab); GoodsView sc = obj.GetComponent <GoodsView>(); sc.init(ps); sc.fatherWindow = window; obj.transform.localScale = new Vector3(0.95f, 0.95f, 1); obj.transform.localPosition = new Vector3(pos * 110 - 20, 0, 0); pos++; // } } }
void updateUI() { fawin.updateCanGetMagicWeaponCount(); numLabel.text = "[6A4D36]" + LanguageConfigManager.Instance.getLanguage("store03") + "[-]" + MagicWeaponScrapManagerment.Instance.getNumString(magicExSamle); thisProp = MagicWeaponScrapManagerment.Instance.getNeedProp(magicExSamle); havePropNum = StorageManagerment.Instance.getProp(thisProp.sid) == null ? 0 : StorageManagerment.Instance.getProp(thisProp.sid).getNum(); if (havePropNum == 0) { buttonDecompostion.disableButton(true); } //按钮显示判断 int count = ExchangeManagerment.Instance.getCanExchangeNum(exchange); if (count <= 0) { buttonExchange.disableButton(true); } else { buttonExchange.disableButton(false); } buttonExchange.fatherWindow = fawin; buttonExchange.updateButton(exchange); //初始化分解按键 buttonDecompostion.fatherWindow = fawin; buttonDecompostion.onClickEvent = beginDecomposion; //显示装备 if (magicExSamle.exType == 8) { MagicWeapon nw = MagicWeaponManagerment.Instance.createMagicWeapon(magicExSamle.exchangeSid); magicW = nw; //更新神器职业背景颜色,用以区分品质 typeQuality.spriteName = QualityManagerment.qualityIconBgToBackGround(magicW.getMagicWeaponQuality()); //显示职业 typeIcon.gameObject.SetActive(true); typeQuality.gameObject.SetActive(true); if (magicW.getMgType() == JobType.POWER) //力 { typeIcon.spriteName = "roleType_2"; } else if (magicW.getMgType() == JobType.MAGIC) //魔 { typeIcon.spriteName = "roleType_5"; } else if (magicW.getMgType() == JobType.AGILE) //敏 { typeIcon.spriteName = "roleType_3"; } else if (magicW.getMgType() == JobType.POISON) //毒 { typeIcon.spriteName = "roleType_4"; } else if (magicW.getMgType() == JobType.COUNTER_ATTACK) //反 { typeIcon.spriteName = "roleType_1"; } else if (magicW.getMgType() == JobType.ASSIST) //辅 { typeIcon.spriteName = "roleType_6"; } else { typeIcon.gameObject.SetActive(false); typeQuality.gameObject.SetActive(false); } nameLabel.text = QualityManagerment.getQualityColor(nw.getMagicWeaponQuality()) + nw.getName(); if (button == null) { item = NGUITools.AddChild(gameObject, goodsViewPrefab); item.name = "goodsView"; button = item.GetComponent <GoodsView>(); button.onClickCallback = showMagicWeapon; } if (button != null && nw != null) { button.init(nw); button.fatherWindow = fawin; button.rightBottomText.text = ""; } } }
public void updateItem(Exchange exc) { exchange = exc; ExchangeSample sample = exc.getExchangeSample(); receiveButton.fatherWindow = fatherWindow; receiveButton.updateButton(exc); //前提条件是否达成 if (!ExchangeManagerment.Instance.isCheckPremises(sample)) { //显示没完成的第一个条件 conditionInfoButton.gameObject.SetActive(true); conditionInfoButton.fatherWindow = fatherWindow; conditionInfoButton.fatherBar = this; conditionInfoButton.textLabel.text = ExchangeManagerment.Instance.checkPremises(sample); premises = false; // changeButton (false); // return ; } else { conditionInfoButton.gameObject.SetActive(false); premises = true; } //兑换条件是否达成 if (!ExchangeManagerment.Instance.isCheckConditions(sample)) { conditions = false; } else { conditions = true; } bool needChangeColor = false; if (costButtons == null) { costButtons = new GoodsView[3]; for (int i = 0; i < costButtons.Length; i++) { costButtons[i] = NGUITools.AddChild(goodsShowPos, goodsViewPre).GetComponent <GoodsView> (); costButtons[i].transform.localPosition = new Vector3(i * 120, 0, 0); costButtons[i].fatherWindow = fatherWindow; costButtons[i].gameObject.SetActive(false); } //显示兑换条件内容 ExchangeCondition exCon; for (int i = 0; i < sample.conditions[0].Length && i < 3; i++) { exCon = sample.conditions[0] [i]; needChangeColor = ExchangeManagerment.Instance.isCheckConditions(sample, 0, i); if (!needChangeColor) { costButtons[i].rightBottomText.color = Color.red; } else { costButtons[i].rightBottomText.color = Color.white; } costButtons[i].gameObject.SetActive(true); costButtons[i].init(exCon.costType, exCon.costSid, exCon.num); } } else { for (int i = 0; i < costButtons.Length; i++) { costButtons[i].gameObject.SetActive(false); } ExchangeCondition exCon; for (int i = 0; i < sample.conditions[0].Length && i < 3; i++) { exCon = sample.conditions [0][i]; needChangeColor = ExchangeManagerment.Instance.isCheckConditions(sample, 0, i); if (!needChangeColor) { costButtons[i].rightBottomText.color = Color.red; } else { costButtons[i].rightBottomText.color = Color.white; } costButtons[i].gameObject.SetActive(true); costButtons[i].init(exCon.costType, exCon.costSid, exCon.num); } } //显示兑换目标物品 if (awardButton == null) { awardButton = NGUITools.AddChild(awardShowPos, goodsViewPre).GetComponent <GoodsView> (); awardButton.transform.localPosition = Vector3.zero; awardButton.fatherWindow = fatherWindow; awardButton.init(sample.type, sample.exchangeSid, sample.num); } else { awardButton.init(sample.type, sample.exchangeSid, sample.num); } if (exc.getExchangeSample().times <= 0) { countLabel.text = ""; } else { countLabel.text = LanguageConfigManager.Instance.getLanguage("s0134") + "(" + exc.getLastNum() + "/" + exc.getExchangeSample().times + ")"; } showTime(); if (timer == null) { timer = TimerManager.Instance.getTimer(UserManager.TIMER_DELAY); } timer.addOnTimer(showTime); timer.start(); changeButton(); }
public void updateItem(Exchange exc) { exchange = exc; ExchangeSample sample = exc.getExchangeSample(); receiveButton.fatherWindow = fatherWindow.win; receiveButton.updateButton(exc); //前提条件是否达成 if (!ExchangeManagerment.Instance.isCheckPremises(sample)) { //显示没完成的第一个条件 conditionInfoButton.gameObject.SetActive(true); conditionInfoButton.fatherWindow = fatherWindow.win; conditionInfoButton.fatherBar = this; conditionInfoButton.textLabel.text = ExchangeManagerment.Instance.checkPremises(sample); premises = false; } else { conditionInfoButton.gameObject.SetActive(false); premises = true; } //兑换条件是否达成 if (!ExchangeManagerment.Instance.isCheckConditions(sample) || (sample.times != 0 && exchange.getNum() >= sample.times)) { conditions = false; } else { conditions = true; } int activeCostButtonNum = 0; if (costButtons == null) { costButtons = new GoodsView[3]; for (int i = 0; i < costButtons.Length; i++) { costButtons [i] = NGUITools.AddChild(goodsShowPos, goodsViewPre).GetComponent <GoodsView> (); costButtons [i].transform.localPosition = new Vector3(i * 120, 0, 0); costButtons [i].fatherWindow = fatherWindow.win; costButtons [i].gameObject.SetActive(false); } //显示兑换条件内容 ExchangeCondition exCon; for (int i = 0; i < sample.conditions[0].Length && i < 3; i++) { exCon = sample.conditions [0][i]; costButtons [i].gameObject.SetActive(true); costButtons [i].init(exCon.costType, exCon.costSid, exCon.num); activeCostButtonNum++; } } else { for (int i = 0; i < costButtons.Length; i++) { costButtons [i].gameObject.SetActive(false); } ExchangeCondition exCon; for (int i = 0; i < sample.conditions[0].Length && i < 3; i++) { exCon = sample.conditions[0] [i]; costButtons [i].gameObject.SetActive(true); costButtons[i].clean(); costButtons [i].init(exCon.costType, exCon.costSid, exCon.num); activeCostButtonNum++; } } //显示兑换目标物品 if (awardButton == null) { awardButton = NGUITools.AddChild(awardShowPos, goodsViewPre).GetComponent <GoodsView> (); awardButton.transform.localPosition = Vector3.zero; awardButton.fatherWindow = fatherWindow.win; awardButton.init(sample.type, sample.exchangeSid, sample.num); } else { awardButton.init(sample.type, sample.exchangeSid, sample.num); } if (activeCostButtonNum > 0) { activeCostButtonNum = activeCostButtonNum > costButtons.Length?costButtons.Length:activeCostButtonNum; awardShowPos.transform.localPosition = new Vector3((activeCostButtonNum - 1) * 120, awardShowPos.transform.localPosition.y, awardShowPos.transform.localPosition.z); spriteArrow.localPosition = new Vector3(-100 + (activeCostButtonNum - 1) * 120, spriteArrow.localPosition.y, spriteArrow.localPosition.z); } if (exc.getLastNum() == int.MaxValue) { countLabel.text = LanguageConfigManager.Instance.getLanguage("s0134") + "(" + Language("exchange04") + ")"; } else { countLabel.text = LanguageConfigManager.Instance.getLanguage("s0134") + "(" + exc.getLastNum() + "/" + exc.getExchangeSample().times + ")"; } showTime(); }
/**特效 */ private void GoodsInFireworksEffect(GameObject obj) { GoodsView view = obj.transform.GetComponent <GoodsView> (); view.showFireworksEffectByQuality(); }