private ExchangeSample magicExSamle; //神器兑换模板 public void init(Exchange ex) { ExchangeSample sample = ex.getExchangeSample(); this.magicExSamle = sample; //按钮显示判断 int count = ExchangeManagerment.Instance.getCanExchangeNum(ex); if (count <= 0) { buttonExchange.disableButton(true); } else { buttonExchange.disableButton(false); } //数量9240c numLabel.text = "[92400c]" + LanguageConfigManager.Instance.getLanguage("store03") + "[-]" + EquipScrapManagerment.Instance.getNumString(sample); //存信息到兑换按钮 buttonExchange.fatherWindow = fawin; buttonExchange.updateButton(ex); //显示装备 if (sample.exType == 8) { MagicWeapon nw = MagicWeaponManagerment.Instance.createMagicWeapon(sample.exchangeSid); magicW = nw; 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 = ""; } } else { Equip equip = EquipManagerment.Instance.createEquip(sample.exchangeSid); //名称 nameLabel.text = QualityManagerment.getQualityColor(equip.getQualityId()) + equip.getName();; if (button == null) { item = NGUITools.AddChild(gameObject, goodsViewPrefab); item.name = "goodsView"; button = item.GetComponent <GoodsView>(); } if (button != null && equip != null) { button.init(equip); button.fatherWindow = fawin; button.rightBottomText.text = ""; } } }
/// <summary> /// 初始化 /// </summary> /// <param name="reward">奖励</param> /// <param name="isAward">是否领取过</param> // public void init (TurnSpriteReward reward, bool isAward) // { // this.isAward = isAward; // CardSample sample = CardSampleManager.Instance.getRoleSampleBySid (reward.sid); // front.init (sample, null, null); // numLabel.text = "x" + reward.num.ToString (); // } public void init(TurnSpriteReward reward, bool isAward) { this.isAward = isAward; _front.clean(); if (reward.type == "card") { CardSample sample = CardSampleManager.Instance.getRoleSampleBySid(reward.sid); front.gameObject.SetActive(true); front.init(sample, null, null); numLabel.text = "x" + reward.num.ToString(); } else if (reward.type == "euip") { PrizeSample sample = new PrizeSample(PrizeType.PRIZE_EQUIPMENT, reward.sid, reward.num); _front.init(sample, true); numLabel.text = "x" + reward.num.ToString(); } else if (reward.type == "goods") { PrizeSample sample = new PrizeSample(PrizeType.PRIZE_PROP, reward.sid, reward.num); _front.gameObject.SetActive(true); _front.init(sample, true); numLabel.text = "x" + reward.num.ToString(); } // else if(reward.type == "starsoul") { // // PrizeSample sample = new PrizeSample(PrizeType.PRIZE_STARSOUL,reward.sid,reward.num); // _front.init (sample); // numLabel.text = "x" + reward.num.ToString (); // } }
private void createGoodsView(string type, int num) { if (goodsView.transform.childCount > 0) { Utils.RemoveAllChild(goodsView.transform); } GameObject goodsObj = NGUITools.AddChild(goodsView.gameObject, goodsPrefab); GoodsView button = goodsObj.GetComponent <GoodsView> (); button.fatherWindow = win; if (type == TempPropType.BEAST || type == TempPropType.CARD) { button.init(CardManagerment.Instance.createCard(temp.sid), num); } else if (type == TempPropType.STARSOUL) { button.init(StarSoulManager.Instance.createStarSoul(temp.sid), num); } else if (type == TempPropType.MAGICWEAPON) { button.init(new MagicWeapon(temp.uid, temp.sid, 0, 0, 0), num); } else { button.init(new Equip(temp.uid, temp.sid, 0, 0, 0, 0), num); } }
//0道具,1装备,2卡片 3,神器 private GameObject CreateGoodsItem(int sid, int count, int type) { GameObject obj = NGUITools.AddChild(awardContent, goodsViewPrefab) as GameObject; obj.SetActive(false); 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 = () => { hideWindow(); UiManager.Instance.openWindow <EquipAttrWindow>( (winEquip) => { winEquip.Initialize(e, EquipAttrWindow.OTHER, () => { EventDelegate.Add(winEquip.OnHide, () => { restoreWindow(); }); }); } ); }; } else if (type == 2) { Card c = CardManagerment.Instance.createCard(sid); view.init(c); view.onClickCallback = () => { hideWindow(); CardBookWindow.Show(c, CardBookWindow.SHOW, () => { EventDelegate.Add(UiManager.Instance.getWindow <CardBookWindow>().OnHide, () => { restoreWindow(); }); }); }; } 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); }
//设置创建按钮信息 private void setCreatButton(PrizeSample _prize) { if (_prize == null) { return; } else { prize = _prize; roleButton.gameObject.SetActive(false); goodsButton.gameObject.SetActive(false); goodsButton.fatherWindow = fatherWindow; switch (prize.type) { case PrizeType.PRIZE_BEAST: roleButton.gameObject.SetActive(true); Card beast = CardManagerment.Instance.createCard(prize.pSid); roleButton.init(beast, fatherWindow, roleButton.DefaultClickEvent); break; case PrizeType.PRIZE_CARD: goodsButton.gameObject.SetActive(true); Card card = CardManagerment.Instance.createCard(prize.pSid); goodsButton.onClickCallback = () => { CardBookWindow.Show(card, CardBookWindow.SHOW, null); fatherWindow.finishWindow(); }; goodsButton.init(card); break; case PrizeType.PRIZE_EQUIPMENT: goodsButton.gameObject.SetActive(true); Equip equip = EquipManagerment.Instance.createEquip(prize.pSid); goodsButton.init(equip, prize.getPrizeNumByInt()); break; case PrizeType.PRIZE_MONEY: goodsButton.gameObject.SetActive(true); goodsButton.init(prize); break; case PrizeType.PRIZE_PROP: goodsButton.gameObject.SetActive(true); Prop prop = PropManagerment.Instance.createProp(prize.pSid); goodsButton.init(prop, prize.getPrizeNumByInt()); break; case PrizeType.PRIZE_RMB: goodsButton.gameObject.SetActive(true); goodsButton.init(prize); break; } if (prizeName != null) { prizeName.text = QualityManagerment.getQualityColor(prize.getQuality()) + prize.getPrizeName(); } } }
/** 初始化道具 */ public void initPropButton(GameObject gameObj, Prop prop, int index) { GameObject obj = NGUITools.AddChild(gameObj, goodsViewPrefab); obj.transform.localScale = new Vector3(1.4f, 1.4f, 1); GoodsView goods = obj.GetComponent <GoodsView> (); goods.fatherWindow = this; goods.linkQualityEffectPoint(); goods.init(prop, 0); goods.onClickCallback = () => { UiManager.Instance.openDialogWindow <PropAttrWindow>((win) => { win.Initialize(prop); }); }; if (cardName != null) { string color = QualityManagerment.getQualityColor(prop.getQualityId()); cardName.text = color + prop.getName() + "[-]"; GameObject card_name = NGUITools.AddChild(obj, cardName.gameObject); card_name.transform.localScale = new Vector3(0.8f, 0.8f, 1); card_name.transform.localPosition = new Vector3(0, -70, 0); card_name.SetActive(true); } }
/** 初始化装备 */ public void initEquipButton(GameObject gameObj, Equip equip, int index) { GameObject obj = NGUITools.AddChild(gameObj, goodsViewPrefab); obj.transform.localScale = new Vector3(1.4f, 1.4f, 1); GoodsView goods = obj.GetComponent <GoodsView> (); goods.fatherWindow = this; goods.linkQualityEffectPoint(); goods.init(equip, 0); goods.onClickCallback = () => { TweenAlpha lname = TweenAlpha.Begin(gameObject, 1f, 0); lname.from = 1; UiManager.Instance.openWindow <EquipAttrWindow> ((winEquip) => { winEquip.Initialize(equip, EquipAttrWindow.OTHER, () => { lname = TweenAlpha.Begin(gameObject, 1.5f, 1); lname.from = 0; }); }); }; if (cardName != null) { string color = QualityManagerment.getQualityColor(equip.getQualityId()); cardName.text = color + equip.getName() + "[-]"; GameObject card_name = NGUITools.AddChild(obj, cardName.gameObject); card_name.transform.localScale = new Vector3(0.8f, 0.8f, 1); card_name.transform.localPosition = new Vector3(0, -70, 0); card_name.SetActive(true); } }
/** 初始化秘宝 */ public void initMagicWeaponButton(GameObject gameObj, MagicWeapon magicWeap, int index) { GameObject obj = NGUITools.AddChild(gameObj, goodsViewPrefab); obj.transform.localScale = new Vector3(1.4f, 1.4f, 1); GoodsView goods = obj.GetComponent <GoodsView>(); goods.fatherWindow = this; goods.linkQualityEffectPoint(); goods.init(magicWeap); goods.onClickCallback = goods.DefaultClickEvent; //goods.onClickCallback = () => { // TweenAlpha lname = TweenAlpha.Begin(gameObject, 1f, 0); // lname.from = 1; // UiManager.Instance.openWindow<MagicWeaponStrengWindow>((win) => { // win.Initialize(magicWeap, EquipAttrWindow.OTHER, () => { // lname = TweenAlpha.Begin(gameObject, 1.5f, 1); // lname.from = 0; // }); // }); //}; if (cardName != null) { string color = QualityManagerment.getQualityColor(magicWeap.getMagicWeaponQuality()); cardName.text = color + magicWeap.getName() + "[-]"; GameObject card_name = NGUITools.AddChild(obj, cardName.gameObject); card_name.transform.localScale = new Vector3(0.8f, 0.8f, 1); card_name.transform.localPosition = new Vector3(0, -70, 0); card_name.SetActive(true); } }
/// <summary> /// 更新星魂视图 /// </summary> private void updateStarSoulView() { if (starSoul == null) { if (viewPoint.transform.childCount > 0) { Utils.RemoveAllChild(viewPoint.transform); } } else { GameObject obj; if (viewPoint.transform.childCount > 0) { obj = viewPoint.transform.GetChild(0).gameObject; } else { obj = NGUITools.AddChild(viewPoint, viewPerfabe); } GoodsView gv = obj.GetComponent <GoodsView>(); gv.setFatherWindow(fatherWindow); gv.onClickCallback = grooveButtonClickHanderr; gv.init(starSoul, GoodsView.BOTTOM_TEXT_NAME_LV); } }
public void updateItem(NoticeActiveGoods goods, NoticeSample sample) { NoticeActiveServerInfo serverInfo = fatherContent.serverInfo; activeGoods = goods; //2014.7.17 modified //conditionDes.text = Language ("ConsumeRebate_01", activeGoods.getSample().rmbCondition, // Mathf.Min (serverInfo.consumeValue, activeGoods.getSample().rmbCondition), activeGoods.getSample().rmbCondition); conditionDes.text = Language("ConsumeRebate_01", activeGoods.getSample().rmbCondition, activeGoods.getRoleCountCanBuy(), activeGoods.getSample().maxBuyCount); costNumLabel.text = "X " + activeGoods.getCostPrice(); totalCountLabel.text = Language("ConsumeRebate_04", activeGoods.getServerCountCanBuy()); //maxBuyLabel.text = Language ("ConsumeRebate_03", activeGoods.getRoleCountCanBuy (), activeGoods.getSample().maxBuyCount); maxBuyLabel.text = Language("ConsumeRebate_03", activeGoods.getSample().rmbCondition - serverInfo.consumeValue > 0 ? activeGoods.getSample().rmbCondition - serverInfo.consumeValue : 0); if (goodsShowPos.transform.childCount > 0) { goodsShowPos.transform.GetChild(0).GetComponent <GoodsView> ().init(activeGoods.getGoodsType(), activeGoods.getGoodsSid(), activeGoods.getGoodsShowNum()); } else { GoodsView goodsView = (NGUITools.AddChild(goodsShowPos, goodsViewPref) as GameObject).GetComponent <GoodsView> (); goodsView.init(activeGoods.getGoodsType(), activeGoods.getGoodsSid(), activeGoods.getGoodsShowNum()); goodsView.fatherWindow = fatherContent.win; } if (activeGoods.getRoleCountCanBuy() < 1 || activeGoods.getServerCountCanBuy() < 1) { buyButton.disableButton(true); } else { buyButton.disableButton(false); buyButton.fatherWindow = fatherContent.win; buyButton.onClickEvent = clickBuyButton; } }
public override void initButton(int i) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, (fatherWindow as SellWindow).equipButtonPrefab); GoodsView view = nodeList [i].GetComponent <GoodsView> (); view.init(equips [i] as Equip); view.fatherWindow = window; view.rightBottomText.gameObject.SetActive(false); view.onClickCallback = () => { OnButtonClick(view); }; if (view.tempGameObj == null) { UISprite us = NGUITools.AddChild <UISprite>(view.gameObject); us.depth = 500; us.atlas = view.rightBottomSprite.atlas; us.spriteName = "gou_3"; us.MakePixelPerfect(); us.gameObject.SetActive(window.isSelect(view.equip)); view.tempGameObj = us.gameObject; } } }
private void updateProp() { if (type == MagicWeaponType.STRENGG) { string[][] props = CommandConfigManager.Instance.getMagicWeaponStrengProp(); int quaIndex = magicWeapon.getMaxPhaseLv(); string[] selectPropList = props[quaIndex - 1]; string selsecNum = magicWeapon.getStrengLv() >= (selectPropList.Length) ? selectPropList[selectPropList.Length - 1] : selectPropList[magicWeapon.getStrengLv()]; Prop p = PropManagerment.Instance.createProp(StringKit.toInt(selsecNum.Split(',')[0])); goodsView.init(p); goodsView.backGround.gameObject.SetActive(false); Prop storeProp = StorageManagerment.Instance.getProp(StringKit.toInt(selsecNum.Split(',')[0])); if (storeProp == null) { needNum.text = "[FF0000]0/" + StringKit.toInt(selsecNum.Split(',')[1]).ToString(); } else { if (storeProp.getNum() < StringKit.toInt(selsecNum.Split(',')[1])) { needNum.text = "[FF0000]" + storeProp.getNum() + "/" + StringKit.toInt(selsecNum.Split(',')[1]).ToString(); } else { needNum.text = storeProp.getNum() + "/" + StringKit.toInt(selsecNum.Split(',')[1]).ToString(); } } } }
/// <summary> /// ÏÔʾ½±Àø£¨½ö½ö¿¨Æ¬ËéƬ£© /// </summary> public void showPrizes() { if (prizes != null) { if (prizePoint.transform.FindChild("goodsView(Clone)") != null) { DestroyImmediate(prizePoint.transform.FindChild("goodsView(Clone)").gameObject); } for (int i = 0; i < prizes.Length; i++) { if (prizes[i].type == PrizeType.PRIZE_PROP) { Prop prop = PropManagerment.Instance.createProp(PropSampleManager.Instance.getPropSampleBySid(prizes[i].pSid).sid); if (prop.isCardScrap() || prop.isRedOmnipotentCardOrScrap()) { GameObject prizeItem = NGUITools.AddChild(prizePoint, prizePrefab); prizeItem.transform.localScale = new Vector3(0.8f, 0.8f, 0); GoodsView prize = prizeItem.GetComponent <GoodsView>(); prize.fatherWindow = fatherWindow; prize.init(prizes[i]); } } } } }
public override void initButton(int i) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, (fatherWindow as ResolveCardChooseWindow).equipButtonPrefab); } nodeList [i].name = StringKit.intToFixString(i + 1); GoodsView view = nodeList [i].GetComponent <GoodsView> (); view.transform.localScale = new Vector3(1.1f, 1.1f, 1); view.init(equips [i] as Equip); view.fatherWindow = chooseWindow; view.onClickCallback = () => { OnButtonClick(view); }; if (view.tempGameObj == null) { UISprite us = NGUITools.AddChild <UISprite> (view.gameObject); us.depth = 300; us.atlas = view.rightBottomSprite.atlas; us.spriteName = "gou_3"; us.MakePixelPerfect(); us.gameObject.SetActive(window.isSelect(view.equip)); view.tempGameObj = us.gameObject; } }
// 初始化半价购买界面// public void initBanjiaPanel(SevenDaysHappyMisson misson) { this.misson = misson; banjia_good.init(misson.prizes[0]); banjia_good.fatherWindow = fatherWin; banjia_goodName.text = banjia_good.showName; banjia_goodsPriceBefore.text = (misson.price * 2).ToString(); banjia_goodsPriceNow.text = misson.price.ToString(); if (banjia_goumaiBtn.onClickEvent == null) { banjia_goumaiBtn.onClickEvent = clickGouMai; } if (misson.missonState == SevenDaysHappyMissonState.Recevied) { banjia_goumaiBtn.disableButton(true); } else { if (SevenDaysHappyManagement.Instance.getActiveMissonEndTime() - ServerTimeKit.getSecondTime() > 0) { banjia_goumaiBtn.disableButton(false); } else { banjia_goumaiBtn.disableButton(true); } } }
/// <summary> /// 开始更新星魂仓库的每一条数据 /// </summary> /// <param name="item">Item.</param> /// <param name="index">Index.</param> public override void updateItem(GameObject item, int index) { PrizeSample prizeSample = prizes [index]; GoodsView button = item.GetComponent <GoodsView> (); button.fatherWindow = winn; button.init(prizeSample); }
//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); }
GameObject initItem(int i) { GameObject item = NGUITools.AddChild(awardContent.gameObject, goodsPrefab); GoodsView button = item.GetComponent <GoodsView> (); button.fatherWindow = this; button.init(awardList [i]); return(item); }
//最原始的初始化 public void init(object obj, int numberMax, int numberMin, int numberNow, int numberSetp, CallBackMsg callback) { msg = new MessageHandle(); msg.msgInfo = obj; item = obj; this.callback = callback; setp = numberSetp; max = numberMax; min = numberMin; now = numberNow; coverDistanceToOne(); updateDisplayeNumber(); GoodsView tmpGoodsView = CreateGoodsView(); Prop prop = item as Prop; tmpGoodsView.init(prop); switch (prop.sid) { case 71197: costProp = PropManagerment.Instance.createProp(71196); break; case 71198: costProp = PropManagerment.Instance.createProp(71197); break; case 71199: costProp = PropManagerment.Instance.createProp(71198); break; case 71200: costProp = PropManagerment.Instance.createProp(71199); break; } goodsName.text = prop.getName(); goods1Name.text = costProp.getName(); goods2Name.text = costProp.getName(); Utils.DestoryChilds(goodsPoint1); GameObject obj1 = NGUITools.AddChild(goodsPoint1, goodsViewProfab) as GameObject; GoodsView obj1View = obj1.transform.GetComponent <GoodsView>(); if (StorageManagerment.Instance.getProp(costProp.sid) != null) { obj1View.init(costProp, StorageManagerment.Instance.getProp(costProp.sid).getNum()); } Utils.DestoryChilds(goodsPoint2); GameObject obj2 = NGUITools.AddChild(goodsPoint2, goodsViewProfab) as GameObject; GoodsView obj2View = obj2.transform.GetComponent <GoodsView>(); if (StorageManagerment.Instance.getProp(costProp.sid) != null) { obj2View.init(costProp, StorageManagerment.Instance.getProp(costProp.sid).getNum()); } }
/***/ public override void initButton(int i) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, goodsPerfab.gameObject); } GoodsView button = nodeList [i].GetComponent <GoodsView> (); button.fatherWindow = winn; button.init(prizes [i]); }
//更新碎片 void updateGetNum() { PrizeSample[] ps = PropSampleManager.Instance.getPropSampleBySid(item.sid).prizes; int propSid = ps[0].pSid; int perNum = StringKit.toInt(ps[0].num); getPropView.fatherWindow = this; getPropView.init(ps[0]); perNumForProp = perNum; getPropNum.text = perNumForProp.ToString(); }
//创建星魂奖励 private GameObject CreateStarSoulGoodsItem(int sid, int num) { GameObject obj = Instantiate(goodsViewPrefab) as GameObject; obj.transform.localScale = new Vector3(0.7f, 0.7f, 1); GoodsView view = obj.transform.GetComponent <GoodsView> (); StarSoul starSoul = StarSoulManager.Instance.createStarSoul(sid); view.init(starSoul); view.fatherWindow = this; return(obj); }
private void creatPrize() { UIUtils.M_removeAllChildren(goodsOffset.gameObject); foreach (PrizeSample p in sample.item) { GameObject go = NGUITools.AddChild(goodsOffset.gameObject, goodsView); GoodsView view = go.GetComponent <GoodsView> (); view.setFatherWindow(win); view.init(p); goodsOffset.Reposition(); } }
public override void updateItem(GameObject item, int index) { // base.updateItem (item, index); GoodsView button = item.GetComponent <GoodsView> (); button.init(equips [index] as Equip, false); button.fatherWindow = chooseWindow; button.onClickCallback = () => { OnButtonClick(button); }; button.tempGameObj.SetActive(window.isSelect(button.equip)); }
/// <summary> /// 创建星魂条目 /// </summary> /// <param name="starSoul">星魂</param> private GameObject CreateStarSoulItem(StarSoul starSoul) { Transform trans = awardContent.transform.FindChild(starSoul.uid); if (trans != null) // 避免出现相同uid的星魂 { GameObject.Destroy(trans.gameObject); } GameObject obj = NGUITools.AddChild(awardContent, goodsViewProfab) as GameObject; obj.transform.localScale = new Vector3(0.85f, 0.85f, 1); GoodsView view = obj.transform.GetComponent <GoodsView> (); view.LockOnClick = false; view.init(starSoul, GoodsView.BOTTOM_TEXT_NAME); view.fatherWindow = tapContent.fatherwindow; view.onClickCallback = () => { StorageManagerment smanager = StorageManagerment.Instance; if (starSoul.getStarSoulType() == 0) // 经验类星魂 { bool isQuality = starSoul.getQualityId() >= QualityType.EPIC?true:false; if (isQuality) { UiManager.Instance.openDialogWindow <MessageWindow> ((win) => { win.msg.msgInfo = starSoul.uid; win.initWindow(2, LanguageConfigManager.Instance.getLanguage("s0094"), LanguageConfigManager.Instance.getLanguage("s0093"), LanguageConfigManager.Instance.getLanguage("StarSoulWindow_storeContent_changeQuality"), doOnClickCallback); }); return; } } else // 非经验类星魂 { if (smanager.isStarSoulStorageFull(1)) // 星魂仓库满 { UiManager.Instance.openDialogWindow <MessageLineWindow>((win) => { win.Initialize(LanguageConfigManager.Instance.getLanguage("StarSoulWindow_StarSoul_Storage_Full")); }); return; } } MessageHandle msg = new MessageHandle(); msg.buttonID = MessageHandle.BUTTON_RIGHT; msg.msgInfo = starSoul.uid; doOnClickCallback(msg); }; view.longPassCallback = () => { UiManager.Instance.openDialogWindow <StarSoulAttrWindow> ( (win) => { win.Initialize(starSoul, StarSoulAttrWindow.AttrWindowType.None); }); }; return(obj); }
/// <summary> /// 初始化奖励 /// </summary> private void initPrize() { GameObject go = Instantiate(goodsView) as GameObject; go.transform.parent = prizePos; go.transform.localPosition = Vector3.zero; go.transform.localScale = Vector3.one; GoodsView view = go.GetComponent <GoodsView>(); view.fatherWindow = win; view.init(sample.prize); }
/// <summary> /// 初始化UI /// </summary> public void initItemUI(FestivalFireworksSample fireworksSample, WindowBase win) { this.win = win; this.fireworksSample = fireworksSample; this.itemSid = fireworksSample.noitceItemSid; this.fireworksSid = fireworksSample.prizes.pSid; this.fireworksLabel.text = QualityManagerment.getQualityColor(fireworksSample.prizes.getQuality()) + fireworksSample.prizes.getPrizeName(); fireworks.init(fireworksSample.prizes); fireworks.rightBottomText.text = "x" + getPropsNum(fireworksSid); fireworks.fatherWindow = win; initButton(); }
/** 初始化条目 */ GameObject initItem(int i) { PrizeSample prizeSample = prizes [i]; GameObject item = NGUITools.AddChild(awardContent.gameObject, goodsViewPrefab); item.transform.localScale = new Vector3(0.9f, 0.9f, 1f); GoodsView button = item.GetComponent <GoodsView> (); button.fatherWindow = this; button.init(prizeSample); return(item); }
GameObject initItem(GameObject obj, int i) { PrizeSample prizeSample = awardList [i]; GameObject item = NGUITools.AddChild(awardContent.gameObject, goodsPrefab); GoodsView button = item.GetComponent <GoodsView> (); button.fatherWindow = this; button.init(prizeSample); return(item); }
public void updateInfo() { cardExpLabel.text = careDec; beastExpLabel.text = beastDec; if (selectPrizeList == null) { return; } for (int i = 0; i < selectPrizeList.Count; i++) { PrizeSample prize = selectPrizeList[i]; if (prize == null) { continue; } GameObject obj = NGUITools.AddChild(awardPoints, goodsVaViewPerfab); GoodsView goodsButton = obj.GetComponent <GoodsView>(); goodsButton.fatherWindow = fatherWindow; goodsButton.onClickCallback = goodsButton.DefaultClickEvent; switch (prize.type) { case PrizeType.PRIZE_BEAST: goodsButton.gameObject.SetActive(true); Card beast = CardManagerment.Instance.createCard(prize.pSid); goodsButton.init(beast, true); break; case PrizeType.PRIZE_CARD: goodsButton.gameObject.SetActive(true); Card card = CardManagerment.Instance.createCard(prize.pSid); goodsButton.init(card, true); break; case PrizeType.PRIZE_EQUIPMENT: goodsButton.gameObject.SetActive(true); Equip equip = EquipManagerment.Instance.createEquip(prize.pSid); goodsButton.init(equip, true); break; case PrizeType.PRIZE_MONEY: goodsButton.gameObject.SetActive(true); PrizeSample prizeMoney = new PrizeSample(PrizeType.PRIZE_MONEY, 0, prize.num); goodsButton.init(prizeMoney, true); break; case PrizeType.PRIZE_PROP: goodsButton.gameObject.SetActive(true); Prop prop = PropManagerment.Instance.createProp(prize.pSid); goodsButton.init(prop, prize.getPrizeNumByInt(), true); break; case PrizeType.PRIZE_RMB: goodsButton.gameObject.SetActive(true); PrizeSample prizeRmb = new PrizeSample(PrizeType.PRIZE_RMB, 0, prize.num); goodsButton.init(prizeRmb, true); break; } } awardPoints.GetComponent <UIGrid>().Reposition(); }