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; } }
//排列跳转目标处的物体 void offsetAllObj() { int count = 0; int height = 0; int line = startIndex / perlineCount; //第一个的x便宜,如果最后一个不是一排里的最后一个,那么startindex指向的那个就可能不是从排头开始 if (endIndex == itemCount - 1 && itemCount % perlineCount != 0 && canFilp) { count = itemCount % perlineCount; } for (int i = 0; i < nodeList.Count; i++) { if (count <= perlineCount - 1) { nodeList [i].transform.localPosition = new Vector3(count * NodeWidth, -(height + line) * NodeHeight, nodeList [i].transform.localPosition.z); } else { count = 0; height += 1; nodeList [i].transform.localPosition = new Vector3(count * NodeWidth, -(height + line) * NodeHeight, nodeList [i].transform.localPosition.z); } nodeList [i].name = StringKit.intToFixString(startIndex + i + 1); count += 1; } }
public override void updateItem(GameObject item, int index) { item.name = StringKit.intToFixString(index + 1); LearningSkillSelectItem sc = item.GetComponent <LearningSkillSelectItem> (); Card c = keys [index]; sc.init(c, map [c]); }
public override void initButton(int i) { nodeList [i] = NGUITools.AddChild(gameObject, (fatherWindow as LaddersFriendsWindow).friendsBarPrefab); nodeList [i].SetActive(true); nodeList [i].name = StringKit.intToFixString(i + 1); Ladders_FriendItem button = nodeList [i].GetComponent <Ladders_FriendItem> (); button.M_update(friends[i]); }
public override void initButton(int i) { nodeList[i] = NGUITools.AddChild(gameObject, (fatherWindow as LadderRuleWindow).ruleItem); nodeList[i].gameObject.SetActive(true); nodeList[i].name = StringKit.intToFixString(i + 1); LadderHeItem button = nodeList[i].GetComponent <LadderHeItem>(); button.initData(prizeInfo[i].rangeLevel, prizeInfo[i]); }
public override void initButton(int i) { nodeList[i] = NGUITools.AddChild(gameObject, (fatherWindow as SdkFriendWindow).awardsBarPrefab); nodeList[i].gameObject.SetActive(true); nodeList[i].name = StringKit.intToFixString(i + 1); InvitePrizeItem button = nodeList[i].GetComponent <InvitePrizeItem>(); button.initItem(prizeInfo[i], fatherWindow); }
public override void initButton(int i) { nodeList [i] = NGUITools.AddChild(gameObject, (fatherWindow as LaddersAwardWindow).prefab_awardItem); nodeList [i].SetActive(true); nodeList [i].name = StringKit.intToFixString(i + 1); Ladders_AwardItem button = nodeList [i].GetComponent <Ladders_AwardItem> (); button.parentScrollView = scrollView; button.M_update(awards[i]); }
public override void initButton(int i) { nodeList [i] = NGUITools.AddChild(gameObject, itemPrefab); nodeList [i].name = StringKit.intToFixString(i + 1); nodeList [i].SetActive(true); GuildMemberItem sc = nodeList [i].GetComponent <GuildMemberItem> (); sc.initInfo(list [i], fatherWindow, guild); }
/// <summary> /// 初始化奖励内容 /// </summary> public override void initButton(int i) { nodeList [i] = NGUITools.AddChild(gameObject, (fatherWindow as WorldbossAwardWindow).prefabAwardItem); nodeList [i].SetActive(true); nodeList [i].name = StringKit.intToFixString(i + 1); WorldbossAwardItem button = nodeList [i].GetComponent <WorldbossAwardItem> (); button.parentScrollView = scrollView; button.initItem(awards [i].prizes); button.setTitle(i + 1); }
public override void initButton(int i) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, festivalWishItemUIPrefab); } nodeList [i].name = StringKit.intToFixString(i + 1); FestivalWishItemUI button = nodeList [i].GetComponent <FestivalWishItemUI> (); button.initItemUI(festivalWishs [i], fatherwindow); }
public override void initButton(int i) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, (fatherWindow as GuildCollegeWindow).guildCollegeItem); } nodeList [i].name = StringKit.intToFixString(i + 1); GuildCollegeItem college = nodeList [i].GetComponent <GuildCollegeItem> (); college.initInfo(skillIds [i], fatherWindow as GuildCollegeWindow); }
public override void initButton(int i) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, timeListPerfab.gameObject); } nodeList [i].name = StringKit.intToFixString(i + 1); TimeListPerfab button = nodeList [i].GetComponent <TimeListPerfab> (); button.init(timelist [i]); }
public override void initButton(int i) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, (fatherWindow as GuildAppWindow).guildAppItem); } nodeList [i].name = StringKit.intToFixString(i + 1); GuildAppItem button = nodeList [i].GetComponent <GuildAppItem> (); button.updateInfo(appList [i], fatherWindow as GuildAppWindow); }
public override void initButton(int i) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, (fatherWindow as WarChooseWindow).warChooseBarPrefab); } nodeList [i].name = StringKit.intToFixString(i + 1); WarChooseButton button = nodeList [i].GetComponent <WarChooseButton> (); button.fatherWindow = fatherWindow; button.updateButton(missonList [i]); }
public override void initButton(int i) { if (nodeList[i] == null) { nodeList[i] = NGUITools.AddChild(gameObject, propPerfab); } nodeList[i].name = StringKit.intToFixString(i + 1); ButtonStoreProp button = nodeList[i].GetComponent <ButtonStoreProp>(); button.fatherWindow = fatherWindow; button.init(props[i], type, indexx); }
void createLearnedButton(int type, int index) { GameObject m = Create3Dobj("ui/skillButton").obj; ButtonSkill button = m.GetComponent <ButtonSkill> (); button.fatherWindow = this; button.transform.parent = contentLearnedSkills.transform; button.transform.localScale = Vector3.one; button.name = "skillButton_" + StringKit.intToFixString(index); button.initSkillData(null, ButtonSkill.STATE_CANLEARN, type); ButtonLearnedSkills.Add(button); }
public override void initButton(int i) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, pvpPrizeItemPrefab); } nodeList [i].name = StringKit.intToFixString(i + 1); PvpPrizeModule button = nodeList [i].GetComponent <PvpPrizeModule> (); button.initialize(samples [i], fatherWindow); }
public override void initButton(int i) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, itemPrefab); nodeList [i].SetActive(true); nodeList [i].name = StringKit.intToFixString(i + 1); RankLadderItemView view = nodeList [i].GetComponent <RankLadderItemView> (); view.M_update(data[i], i + 1); view.setFatherWindow(this.fatherWindow); } }
public override void initButton(int i) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, heContent.laddderHePrefab); } nodeList [i].name = StringKit.intToFixString(i + 1); ButtonShopGoods button = nodeList [i].GetComponent <ButtonShopGoods> (); button.fatherWindow = fatherWindow; button.updateGoods(goods [i] as Goods, shopUpdate, type); }
public override void initButton(int i) { if (nodeList[i] == null) { nodeList[i] = NGUITools.AddChild(this.gameObject, (fatherWindow as ActivityChooseWindow).goodsPrefab); } nodeList[i].name = StringKit.intToFixString(i + 1); GoodsView button = nodeList[i].GetComponent <GoodsView>(); button.fatherWindow = fatherWindow; button.init(prizeList[i]); }
public override void initButton(int i) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, (fatherWindow as TaskWindow).taskitem); } nodeList [i].name = StringKit.intToFixString(i + 1); ButtonTask button = nodeList [i].GetComponent <ButtonTask> (); button.fatherWindow = fatherWindow; button.initialize(tasks [i]); }
public override void initButton(int i) { if (nodeList[i] == null) { //注意fatherWindow一定要有值 nodeList[i] = NGUITools.AddChild(this.gameObject, (fatherWindow as NvshenShopWindow).nvShenButtonPrefab); } nodeList [i].name = StringKit.intToFixString(i + 1); ButtonNvShenShopGoods button = nodeList[i].GetComponent <ButtonNvShenShopGoods>(); button.fatherWindow = fatherWindow; button.updateGoods(goods [i] as Goods, shopUpdate); }
public override void initButton(int i) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, (fatherWindow as MailWindow).templtemPrefab); } nodeList [i].name = StringKit.intToFixString(i + 1); ButtonTempProp button = nodeList [i].GetComponent <ButtonTempProp> (); button.fatherWindow = fatherWindow; button.initialize(temps [i] as TempProp); }
public override void initButton(int i) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, (activityBase as BackRechargeContent).backRechargePrefab); } nodeList [i].name = StringKit.intToFixString(i + 1); BackRechargeBarCtrl ctrl = nodeList [i].GetComponent <BackRechargeBarCtrl> (); ctrl.fatherWindow = activityBase as BackRechargeContent; ctrl.updateItem(rechargeList[i], sample, notice); }
public override void initButton(int i) { if (nodeList[i] == null) { nodeList[i] = NGUITools.AddChild(this.gameObject, (fatherWindow as BoxShowWindow).itemButtonPrefab); } nodeList [i].name = StringKit.intToFixString(i + 1); BoxShowItem button = nodeList[i].GetComponent <BoxShowItem>(); button.BoxButton.fatherWindow = fatherWindow; button.fawin = fatherWindow; button.updateItem(i); }
public override void initButton(int i) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, (fatherWindow as InviteCodeWindow).inviteCodeButtonPrefab); } nodeList [i].name = StringKit.intToFixString(i + 1); InviteCodeButton button = nodeList [i].GetComponent <InviteCodeButton> (); button.fatherWindow = fatherWindow; button.initUI(ic [i], i); }
/// <summary> /// 更新奖励视图 /// </summary> /// <param name="samples">Samples.</param> private void M_updateAwardSample(PrizeSample[] samples) { UIUtils.M_removeAllChildren(root_award); for (int i = 0, length = samples.Length; i < length; i++) { GameObject a = NGUITools.AddChild(root_award, goodsViewPrefab); a.name = StringKit.intToFixString(i + 1); GoodsView goodsButton = a.GetComponent <GoodsView> (); goodsButton.fatherWindow = this; goodsButton.onClickCallback = goodsButton.DefaultClickEvent; goodsButton.init(samples [i]); } root_award.GetComponent <UIGrid> ().Reposition(); }
/// <summary> /// 更新奖励 /// </summary> /// <param name="_data">_data.</param> public void M_update(LaddersAwardSample _data) { data = _data; label_name.text = data.name; PrizeSample[] prizes = data.samples; GameObject newGo; GoodsView goodsButton; UIUtils.M_removeAllChildren(root_prize); for (int i = 0, length = prizes.Length; i < length; i++) { newGo = NGUITools.AddChild(root_prize, prefab_GoodsView); newGo.SetActive(true); newGo.name = StringKit.intToFixString(i + 1); newGo.GetComponent <UIDragScrollView> ().scrollView = parentScrollView; goodsButton = newGo.GetComponent <GoodsView> (); //goodsButton.fatherWindow = this; //goodsButton.onClickCallback = goodsButton.DefaultClickEvent; goodsButton.init(prizes [i]); } root_prize.GetComponent <UIGrid> ().Reposition(); LaddersMedalSample medal = LaddersConfigManager.Instance.config_Medal.M_getMedal(_data.minRank); //不存在奖章奖励时,显示:排名500名以外,无奖章奖励 if (medal == null) { HideMedalInfo(); } //存在奖章奖励时,显示奖章奖励 else { ShowMedalInfo(medal); } /* * if(data.index>=5) * { * sprite_nomal_bg.gameObject.SetActive(true); * sprite_medal_bg.gameObject.SetActive(false); * }else * { * sprite_nomal_bg.gameObject.SetActive(false); * sprite_medal_bg.gameObject.SetActive(true); * sprite_medal_bg.spriteName="medal_"+(data.index+1); * } */ }
public override void initButton(int i) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, itemPrefab); } nodeList [i].name = StringKit.intToFixString(i + 1); LearningSkillSelectItem sc = nodeList [i].GetComponent <LearningSkillSelectItem> (); sc.window = fatherWindow as LearnSkillSelectWindow; Card c = keys [i]; sc.init(c, map [c]); }
public override void initButton(int i) { if (sample.type == NoticeType.EXCHANGENOTICE || sample.type == NoticeType.NEW_EXCHANGE) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, (activityBase as NoticeActivityExchangeContent).NoticeActivityExchangePrefab); } nodeList [i].name = StringKit.intToFixString(i + 1); NoticeActivityExchangeBarCtrl ctrl = nodeList [i].GetComponent <NoticeActivityExchangeBarCtrl> (); ctrl.fatherWindow = activityBase as NoticeActivityExchangeContent; ctrl.updateItem(exchangeList [i]); } else if (sample.type == NoticeType.TOPUPNOTICE || sample.type == NoticeType.COSTNOTICE || sample.type == NoticeType.TIME_RECHARGE || sample.type == NoticeType.NEW_RECHARGE || sample.type == NoticeType.NEW_CONSUME) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, (activityBase as NoticeActivityRechargeContent).NoticeActivityRechargePrefab); } nodeList [i].name = StringKit.intToFixString(i + 1); NoticeActivityRechargeBarCtrl ctrl = nodeList [i].GetComponent <NoticeActivityRechargeBarCtrl> (); ctrl.fatherWindow = activityBase as NoticeActivityRechargeContent; ctrl.updateItem(rechargeList [i], sample, notice); } else if (sample.type == NoticeType.CONSUME_REBATE) { if (nodeList [i] == null) { nodeList [i] = NGUITools.AddChild(gameObject, (activityBase as NoticeConsumeRebateContent).noticeActivityShopPrefab); } nodeList [i].name = StringKit.intToFixString(i + 1); NoticeActivityShopBarCtrl ctrl = nodeList [i].GetComponent <NoticeActivityShopBarCtrl> (); ctrl.fatherContent = activityBase as NoticeConsumeRebateContent; ctrl.updateItem(consumeRebateList [i], sample); } else if (sample.type == NoticeType.ONE_MANY_RECHARGE) { if (nodeList[i] == null) { nodeList[i] = NGUITools.AddChild(gameObject, (activityBase as NoticeOneManyRechargeContent).NoticeOneManyRechargePrefab); } nodeList[i].name = StringKit.intToFixString(i + 1); NoticeOneManyRechargeItem ctrl = nodeList[i].GetComponent <NoticeOneManyRechargeItem>(); ctrl.fatherWindow = activityBase as NoticeOneManyRechargeContent; ctrl.updateItem(rechargeList[i], sample, notice); } }