/// <summary> /// 开启宝箱 /// </summary> /// <param name="senction"></param> public void OpenTreasure(string name) { BattleData data = JsonMgr.GetSingleton().GetChapter((BattleMgr.Instance.SectionKey + 1) * 100 + (BattleMgr.Instance.SectionChapter + 1)); Debug.Log(data.ChapterId); if (BattleMgr.Instance.Genlevel[BattleMgr.Instance.SectionKey][BattleMgr.Instance.SectionChapter].StarCount >= 4 && BattleMgr.Instance.Genlevel[BattleMgr.Instance.SectionKey][BattleMgr.Instance.SectionChapter].isGet_4 == false && name == "Clear_4") { Clear_4_btn.gameObject.SetActive(false); Open_4_obj.SetActive(true); BattleMgr.Instance.Genlevel[BattleMgr.Instance.SectionKey][BattleMgr.Instance.SectionChapter].isGet_4 = true; return; } if (BattleMgr.Instance.Genlevel[BattleMgr.Instance.SectionKey][BattleMgr.Instance.SectionChapter].StarCount >= 8 && BattleMgr.Instance.Genlevel[BattleMgr.Instance.SectionKey][BattleMgr.Instance.SectionChapter].isGet_8 == false && name == "Clear_8") { Clear_8_btn.gameObject.SetActive(false); Open_8_obj.SetActive(true); BattleMgr.Instance.Genlevel[BattleMgr.Instance.SectionKey][BattleMgr.Instance.SectionChapter].isGet_8 = true; return; } if (BattleMgr.Instance.Genlevel[BattleMgr.Instance.SectionKey][BattleMgr.Instance.SectionChapter].StarCount >= 12 && BattleMgr.Instance.Genlevel[BattleMgr.Instance.SectionKey][BattleMgr.Instance.SectionChapter].isGet_12 == false && name == "Clear_12") { Clear_12_btn.gameObject.SetActive(false); Open_12_obj.SetActive(true); BattleMgr.Instance.Genlevel[BattleMgr.Instance.SectionKey][BattleMgr.Instance.SectionChapter].isGet_12 = true; return; } }
public void Init(int _heroid) { if (ct == null) { ct = GameObject.Find("ProcessCtrl").transform; } ; if (ct.childCount > 0) { for (int i = 0, length = ct.childCount; i < length; ++i) { Destroy(ct.GetChild(0).gameObject); } } GameObject heroGo = ResourceMgr.Instance.LoadResource(_heroid) as GameObject; Hero hero = JsonMgr.GetSingleton().GetHeroByID(_heroid); string[] hint = hero.desc.Split(new char[2] { '#', ' ' }); GeneralName_txt.text = hero.name; Hint_txt.text = hint[0]; quarry_txt.text = hint[hint.Length - 1]; if (heroGo == null) { return; } heroGo = Instantiate(heroGo, ct, false); heroGo.transform.localPosition = new Vector3(0, -3, 0); heroGo.transform.localScale = new Vector3(2.5f, 2.5f, 2.5f); heroGo.SetLayer("Hero"); }
/// <summary> /// 为战斗单位创建VIew /// </summary> /// <param name="unit"></param> private void _createFightUnitView(FightUnit unit) { int resId = 0; int horseId = 0; if (!unit.IsMonster) { Hero chero = JsonMgr.GetSingleton().GetHeroByID(unit.HeroId); resId = chero.resid; horseId = chero.horseid; } else { Monster chero = JsonMgr.GetSingleton().GetMonsterByID(unit.HeroId); resId = chero.resid; horseId = chero.horseid; } GameObject fighterObj = GameObject.Instantiate(ResourceMgr.Instance.LoadResource(resId) as GameObject); GameObject horseObj = null; if (horseId > 0) { horseObj = GameObject.Instantiate(ResourceMgr.Instance.LoadResource(horseId) as GameObject); horseObj.transform.parent = fighterObj.transform; horseObj.transform.localPosition = Vector3.zero; } FightUnitView fightUnitView = fighterObj.AddComponent <FightUnitView>(); fightUnitView.unit = unit; fightUnitView.Horse = horseObj; fightUnitView.Init(resId); }
public void SignIn(int _id) { int day = 0; foreach (var item in SignInItem) { if (item.Key <= _id) { day++; item.Value.shade_obj.SetActive(true); } } signInNum_txt.text = day.ToString(); if (Role.Instance.SignInID == _id) { return; } Role.Instance.SignInID = _id; GetAward_obj.SetActive(true); JObject singin = JsonMgr.GetSingleton().Getactivity_sign(_id); ItemConfig ic = JsonMgr.GetSingleton().GetItemConfigByID(singin["ItemId"].ToObject <int>()); itemlevelbg_img.sprite = ResourceMgr.Instance.LoadSprite(ColorMgr.Border[ic.rare - 1]); item_img.sprite = ResourceMgr.Instance.LoadSprite(ic.icon); num_txt.text = singin["ItemNum"].ToString(); }
/// <summary> /// 对货物赋值 /// </summary> public void UpdateShop() { int CurrencyId = 20043; for (int i = 0; i < goodsList.Count; i++) { ItemConfig item = JsonMgr.GetSingleton().GetItemConfigByID(ShopMgr.Instance.goodsList[(int)ShopType.westernshop][i].item_id); if (ShopMgr.Instance.goodsList[(int)ShopType.westernshop][i].num == 1) { goodsList[i].goodsnum_txt.text = ""; goodsList[i].GoodsName_txt.text = item.name; } else { goodsList[i].GoodsName_txt.text = item.name + "×" + ShopMgr.Instance.goodsList[(int)ShopType.westernshop][i].num.ToString(); goodsList[i].goodsnum_txt.text = ShopMgr.Instance.goodsList[(int)ShopType.westernshop][i].num.ToString(); } goodsList[i].GoodsLevel_img.sprite = ResourceMgr.Instance.LoadSprite(ColorMgr.Border[item.rare - 1]); goodsList[i].Goods_img.sprite = ResourceMgr.Instance.LoadSprite(item.icon); goodsList[i].goodsUIId = ShopMgr.Instance.goodsList[(int)ShopType.westernshop][i].item_id; //if (ShopMgr.Instance.goodsList[(int)ShopType.westernRegionsShop][i].saled == true) // goodsList[i].SoldOut_btn.gameObject.SetActive(false); //else // goodsList[i].SoldOut_btn.gameObject.SetActive(true); //if (ShopMgr.Instance.goodsList[(int)ShopType.westernRegionsShop][i].currencyType == 1) // CurrencyId = 20044; //else // CurrencyId = 20043; goodsList[i].copper_img.sprite = ResourceMgr.Instance.LoadSprite(CurrencyId); goodsList[i].price_txt.text = ShopMgr.Instance.goodsList[(int)ShopType.westernshop][i].price.ToString(); } //滑动窗显示 goodslist_obj.GetComponent <RectTransform>().anchoredPosition = new Vector2(SCROLLNUM * SCROLLSIZE, 0); }
private void _analyzeSkillRes(int skillId, ref HashSet <int> sound, ref HashSet <int> gos) { Skill jSkill = JsonMgr.GetSingleton().GetSkillByID(skillId); if (jSkill == null) { EDebug.LogErrorFormat("PreloadMgr._analyzeSkillRes failed, no such skill:{0}", skillId); return; } //技能特效 int startEffect = jSkill.starteffect; int fulleffect = jSkill.fulleffect; int attackeffect = jSkill.attackeffect; if (startEffect != 0) { gos.Add(startEffect); } if (fulleffect != 0) { gos.Add(fulleffect); } if (attackeffect != 0) { gos.Add(attackeffect); } //分析技能效果 int[] skillEffects = jSkill.effects; for (int idx = 0; idx < skillEffects.Length; ++idx) { int effectId = skillEffects[idx]; _analyzeEffect(effectId, ref sound, ref gos); } }
public void Init() { role = RoleSort.ManFirst; GameObject Login = null; GameObject SelectPer = null; Login = GameObject.Find("Login(Clone)").gameObject; SelectPer = GameObject.Find("SelectPer").gameObject; SetChildLayer(Login, 9); SetChildLayer(SelectPer, 0); ManRole = SelectPer.transform.Find("ManRole").transform; WomanRole = SelectPer.transform.Find("WomanRole").transform; int idx = 11010; foreach (Transform item in ManRole) { ManRoleList.Add(item.gameObject); RolePlayer.Add(idx, item.GetComponent <Animator>()); idx += 10; } foreach (Transform item in WomanRole) { RolePlayer.Add(idx, item.GetComponent <Animator>()); WomanRoleList.Add(item.gameObject); idx += 10; } Import_input.text = JsonMgr.GetSingleton().RandomName(isMan); }
public void RemoveBuff(uint uid) { int tplid = -1; for (int idx = 0; idx < _allBuff.Count; ++idx) { Buff buf = _allBuff[idx]; if (buf.UID == uid) { if (buf.Type == BuffType.Time) { TakeEffect(buf, true); } tplid = buf.BuffId; //标记为删除 buf.IsUsing = false; break; } } if (tplid > 0 && 0 == getCurLayer(tplid)) { JObject cbuff = JsonMgr.GetSingleton().GetBuff(tplid); int resid = cbuff["resid"].ToObject <int>(); bool onfoot = cbuff["onfoot"].ToObject <int>() != 0; if (resid > 0) { //通知显示层移除特效 ZEventSystem.Dispatch(EventConst.OnFightUnitAddBuff, this._unit, resid, onfoot, false); } } }
private void _setShowHero(bool isCreate = false, int heroId = 0) { if (_stubShowHero != null) { DestroyImmediate(_stubShowHero); _stubShowHero = null; } if (isCreate) { Hero heroData = JsonMgr.GetSingleton().GetHeroByID(heroId); GameObject heroGo = GameObject.Instantiate(ResourceMgr.Instance.LoadResource(heroData.ID) as GameObject, StubDrag_bb.GetCamPos() + new Vector3(0, -2, 5), Quaternion.Euler(0, 125.75f, 0)); if (heroGo != null) { _stubShowHero = heroGo; if (heroData.horseid != 0) { GameObject horseGo = GameObject.Instantiate(ResourceMgr.Instance.LoadResource(heroData.horseid) as GameObject, heroGo.transform); horseGo.transform.localPosition = Vector3.zero; horseGo.transform.localScale = Vector3.one; } _stubShowHero.SetLayer(StubDrag_bb.Layer); } } }
public DropMgr() { _treasureBox = ResourceMgr.Instance.LoadResource(1048) as GameObject; TreasureSize = JsonMgr.GetSingleton().GetGlobalIntArrayByID(1008).value; TreasureRate = JsonMgr.GetSingleton().GetGlobalIntArrayByID(1009).value; TreasureLife = JsonMgr.GetSingleton().GetGlobalIntArrayByID(1010).value; }
/// <summary> /// 点击半身像弹出聊天气泡框 /// </summary> /// <param name="isClick"></param> public void ClickHead(int type) { words_obj.SetActive(true); if (cg == null) { cg = words_img.GetComponent <CanvasGroup>(); } cg.alpha = 1; timer = 0; if (type == (int)ShopType.ordinaryshop) { words_txt.text = JsonMgr.GetSingleton().GetGlobalStringArrayByID(UnityEngine.Random.Range(1001, 1011)).desc; } else if (type == (int)ShopType.passbarriershop) { words_txt.text = JsonMgr.GetSingleton().GetGlobalStringArrayByID(UnityEngine.Random.Range(1011, 1021)).desc; } else if (type == (int)ShopType.competitiveshop) { words_txt.text = JsonMgr.GetSingleton().GetGlobalStringArrayByID(UnityEngine.Random.Range(1021, 1031)).desc; } else if (type == (int)ShopType.guildshop) { words_txt.text = JsonMgr.GetSingleton().GetGlobalStringArrayByID(UnityEngine.Random.Range(1031, 1041)).desc; } else if (type == (int)ShopType.westernshop) { words_txt.text = JsonMgr.GetSingleton().GetGlobalStringArrayByID(UnityEngine.Random.Range(1051, 1061)).desc; } }
public void SetHeroTotemView(HeroData hero) { string unlock = JsonMgr.GetSingleton().GetGlobalStringArrayByID(10001).desc; string[] temp = unlock.Split('#'); int[] unLockLv = new int[temp.Length]; for (int i = 0; i < unLockLv.Length; ++i) { unLockLv[i] = int.Parse(temp[i]); } for (int i = 0, lv = hero.Level; i < unLockLv.Length; ++i) { lockImg[i].SetAlpha(unLockLv[i] <= lv ? 0 : 1); if (unLockLv[i] <= lv) { if (i < hero.GetTotem().Length) { div[i].SetView(hero.GetTotem()[i], unLockLv[i]); } else { div[i].SetView(null, unLockLv[i]); } } else { div[i].Lock(unLockLv[i]); } } }
/// <summary> /// 点击背包按钮,背包内有物品时默认出现物品弹框 /// </summary> public void ItemPop(List <ItemUIView> itemUIList) { if (itemUIList.Count != 0) { inventorypop_obj.gameObject.SetActive(true); curId = itemUIList[0].itemUIid; SelectItemEffect(itemUIList[0]); ItemConfig ic = JsonMgr.GetSingleton().GetItemConfigByID(itemUIList[0].itemUIid); itemiconcolor_img.sprite = ResourceMgr.Instance.LoadSprite(ColorMgr.Border[ic.rare - 1]); itemicon_img.sprite = ResourceMgr.Instance.LoadSprite(ic.icon); itemname_txt.text = JsonMgr.GetSingleton().GetItemConfigByID(itemUIList[0].itemUIid).name; quantity_txt.text = itemUIList[0].num_txt.text; propertydes_txt.text = JsonMgr.GetSingleton().GetItemConfigByID(itemUIList[0].itemUIid).propertydes; use_txt.text = JsonMgr.GetSingleton().GetItemConfigByID(itemUIList[0].itemUIid).usedes; unitprice_txt.text = JsonMgr.GetSingleton().GetItemConfigByID(itemUIList[0].itemUIid).price.ToString(); if (JsonMgr.GetSingleton().GetItemConfigByID(itemUIList[0].itemUIid).type == FuncType.CONSUMABLES) { use_btn.gameObject.SetActive(true); details_btn.gameObject.SetActive(false); } else { details_btn.gameObject.SetActive(true); use_btn.gameObject.SetActive(false); } } else { return; } }
private void _setStubHero(int stubPos, bool isCreate = false, int heroId = 0) { //不管是创建还是删除,都得先删除了 if (_stubHeroDic.ContainsKey(stubPos)) { DestroyImmediate(_stubHeroDic[stubPos]); _stubHeroDic.Remove(stubPos); _stubPosDic[stubPos].SetStubState(StubState.Open); } if (isCreate) { UIBillboard _bb = null; if (0 == stubPos) { _bb = StubDrag_bb; } else { _bb = StubShow_bb; } if (_bb == null) { EDebug.LogErrorFormat("StubView._setStubHero error, stubPos:{0}", stubPos); return; } Hero heroData = JsonMgr.GetSingleton().GetHeroByID(heroId); GameObject heroGo = null; if (stubPos != 0) { int stubX = stubPos / 10; int stubY = stubPos % 10; heroGo = GameObject.Instantiate(ResourceMgr.Instance.LoadResource(heroData.ID) as GameObject, _bb.GetCamPos() + new Vector3((stubX - 1) * StubXSpace3D + (6 - stubY) * LeanOffset3D - 15f, (6 - stubY) * StubYSpace3D - 11f, 5), Quaternion.Euler(0, 125.75f, 0)); heroGo.transform.localScale = Vector3.one * 1.8f; } else { heroGo = GameObject.Instantiate(ResourceMgr.Instance.LoadResource(heroData.ID) as GameObject, _bb.GetCamPos() + new Vector3(0, 0, 5), Quaternion.Euler(0, 125.75f, 0)); } if (heroGo != null) { _stubHeroDic.Add(stubPos, heroGo); if (heroData.horseid != 0) { GameObject horseGo = GameObject.Instantiate(ResourceMgr.Instance.LoadResource(heroData.horseid) as GameObject, heroGo.transform); horseGo.transform.localPosition = Vector3.zero; horseGo.transform.localScale = Vector3.one; } heroGo.SetLayer(_bb.Layer); } else { EDebug.LogErrorFormat("StubView._setStubHero error, load heroGo failed, heroId:{0}", heroData.ID); } _stubPosDic[stubPos].SetStubState(StubState.Stubed); } }
private void SetRandomView() { randomequip_img.sprite = ResourceMgr.Instance.LoadSprite(equip.ItemData.icon); randomlvfloor_cr.SetAlpha(equip.StrengthenLv); randomlv_txt.text = equip.StrengthenLv > 0 ? " +" + equip.StrengthenLv: ""; randomborder_img.sprite = ResourceMgr.Instance.LoadSprite(ColorMgr.Border[equip.ItemData.rare - 1]); equipname_txt.text = equip.ItemData.name; StringBuilder append = new StringBuilder(); for (int i = 0, length = equip.wishs.Length; i < length; ++i) { append.Append(AttrUtil.GetAttribute(equip.wishs[i].wish.attr)); append.Append(": +"); append.Append(AttrUtil.ShowText(equip.wishs[i].wish.attr, equip.wishs[i].wish.num, equip.wishs[i].wish.per)); append.Append("\n"); locks[i].isOn = equip.wishs[i].isLock; } oldattr_txt.text = append.ToString(); StringBuilder temp = new StringBuilder(); for (int i = 0, length = equip.tempWishs.Length; i < length; ++i) { temp.Append(AttrUtil.GetAttribute(equip.tempWishs[i].attr)); temp.Append(": +"); temp.Append(AttrUtil.ShowText(equip.tempWishs[i].attr, equip.tempWishs[i].num, equip.tempWishs[i].per)); temp.Append("\n"); } newattr_txt.text = temp.ToString(); randomspend_txt.text = JsonMgr.GetSingleton().GetGlobalIntArrayByID(expend).value.ToString(); }
public void ClearBuff(ClearBuffType type) { for (int idx = 0; idx < _allBuff.Count; ++idx) { Buff buff = _allBuff[idx]; JObject cbuff = JsonMgr.GetSingleton().GetBuff(buff.BuffId); int dispelType = cbuff["dispel"].ToObject <int>(); //所有Buff都能清空 if (type == ClearBuffType.All) { RemoveBuff(buff.UID); } else { //不能驱散不能净化 if (0 == dispelType) { continue; } if (dispelType == (int)type || type == ClearBuffType.Both) { RemoveBuff(buff.UID); } } } }
public override void Awake() { base.Awake(); locks = lock_trf.GetComponentsInChildren <Toggle>(); for (int i = 0; i < locks.Length; ++i) { Toggle t = locks[i]; t.isOn = false; t.onValueChanged.AddListener((bool value) => { if (value) { if (expend >= 1027) { t.isOn = false; CanvasView.Instance.AddNotice("最多只能锁定两条属性"); } expend++; } else { expend--; } randomspend_txt.text = JsonMgr.GetSingleton().GetGlobalIntArrayByID((int)expend).ToString(); }); } }
public void SetView(MaterialSpend material) { ItemConfig ic = JsonMgr.GetSingleton().GetItemConfigByID(material.material); if (ic == null) { return; } MaterialBorder_img.sprite = ResourceMgr.Instance.LoadSprite(ColorMgr.Border[ic.rare - 1]); Material_img.sprite = ResourceMgr.Instance.LoadSprite(ic.icon); int haveNum = ItemMgr.Instance.GetItemNum(material.material); if (num_txt.color != Color.red) { c = num_txt.color; } if (ic.type == FuncType.EQUIP) { haveNum = 1; } num_txt.text = haveNum + "/" + material.num; if (haveNum < material.num) { num_txt.color = Color.red; } else { num_txt.color = c; } }
public void SetInfo(int headid, string playername, int herocnt, string corpsName, Dictionary <int, int> stubData, bool isPvp = false, int arenaRank = 0, int arenaWin = 0) { //TODO:headid this.name_txt.text = playername; this.herocnt_txt.text = herocnt.ToString(); this.corpsname_txt.text = corpsName; foreach (var p in _stubui) { p.Value.sprite = StubEmpty; } foreach (var p in stubData) { if (_stubui.ContainsKey(p.Key)) { JsonData.Hero heroData = JsonMgr.GetSingleton().GetHeroByID(p.Value); _stubui[p.Key].sprite = ResourceMgr.Instance.LoadSprite(heroData.headid); } else { EDebug.LogErrorFormat("PlayerInfoDetailView.SetInfo failed, _stubui doesn't contains stubpos {0}", p.Key); } } this.arena_obj.SetActive(isPvp); if (isPvp) { this.arenarank_txt.text = arenaRank.ToString(); this.arenawin_txt.text = arenaWin.ToString(); } }
public void Affirm(bool rename) { if (rename) { if (JsonMgr.GetSingleton().ExamineShieldWord(this.mView.Name_input.text)) { if (Role.Instance.Gold > 100) { Role.Instance.RoleName = this.mView.Name_input.text; this.mView.Placeholder_txt.text = this.mView.Name_input.text; this.mView.Name_txt.text = this.mView.Name_input.text; Role.Instance.Gold -= 100; } else { CanvasView.Instance.AddNotice("元宝不足,无法修改!"); } } else { CanvasView.Instance.AddNotice("昵称内包含屏蔽字样,请修改!"); } } UIFace.GetSingleton().Close(UIID.Tip); this.mView.ChangeName_obj.SetActive(false); }
/// <summary> /// 点击售罄货物时,半身像弹出聊天气泡框 /// </summary> /// <param name="goods"></param> public void ClickSoldBtn(GoodsUIView goods) { words_obj.SetActive(true); cg.alpha = 1; words_txt.text = JsonMgr.GetSingleton().GetGlobalStringArrayByID(UnityEngine.Random.Range(1041, 1051)).desc; WordsHidden(); }
/// <summary> /// 召唤怪物 /// </summary> /// <param name="monsterId"></param> /// <param name="isEnemy"></param> /// <param name="ambush"></param> public void Summon(int monsterId, int level, bool isEnemy, int num, bool ambush = false) { if (num <= 0) { EDebug.LogErrorFormat("FightLogic.Summon failed, invalid monster num : {0}", num); return; } monsterId += (level - 1); for (int idx = AllFighters.Count - 1; idx > 0; --idx) { FightUnit unit = AllFighters[idx]; if (unit.IsDead || !unit.IsSummon) { continue; } if (unit.HeroId == monsterId) { ZEventSystem.Dispatch(EventConst.ForceDestroyView, unit); AllFighters.RemoveAt(idx); } } for (int idx = 0; idx < num; ++idx) { int summonPos = -1; for (int stubX = 0; stubX < PathFinder.H_GRID; ++stubX) { for (int stubY = 0; stubY < PathFinder.V_GRID; ++stubY) { int fightPos = PathFinder.Stub2InitPos(CurRound, (ambush ? !isEnemy : isEnemy), (stubX + 1) * 10 + (stubY + 1)); if (!CheckGridPosOccupy(fightPos)) { summonPos = fightPos; break; } } } if (summonPos >= 0) { Monster monster = JsonMgr.GetSingleton().GetMonsterByID(monsterId); if (monster == null) { EDebug.LogErrorFormat("Summon failed, could not find monster {0} from json", monsterId); return; } FightUnit summon = new FightUnit(monster, 0, isEnemy, true); summon.UID = ++UID; _createFightUnitView(summon); summon.PathFinderObj.SetPos(summonPos); AllFighters.Add(summon); ZEventSystem.Dispatch(EventConst.OnCreateSummon, summon); } else { EDebug.Log("Summon failed, could not find summonPos"); } } }
public void SetView(int tipId, string[] format) { Tip tip = JsonMgr.GetSingleton().GetTipByID(tipId); left_txt.supportRichText = right_txt.supportRichText = tip.Rich; left_txt.text = tip.Left; right_txt.text = tip.Right; content_txt.text = string.Format(tip.Content, format); }
public void Endow(int icoid, bool isboss) { EnemyID = icoid; Monster monster = JsonMgr.GetSingleton().GetMonsterByID(icoid); EnemySign.SetActive(isboss); EnemyIco.sprite = ResourceMgr.Instance.LoadSprite(monster.headid); EnemylevelIco.sprite = ResourceMgr.Instance.LoadSprite(JsonMgr.GetSingleton().GetHeroRareByID(monster.rare).HeadBorder); }
private void _setHeroInfo(int headId, int rare) { if (headId > 0) { this.Head_img.sprite = ResourceMgr.Instance.LoadSprite(headId); } int headBorder = JsonMgr.GetSingleton().GetHeroRareByID(rare).HeadBorder; this.Color_img.sprite = ResourceMgr.Instance.LoadSprite(headBorder); }
public void Endow(int _mailid, Item _item) { idUse = true; MailId = _mailid; transform.gameObject.SetActive(true); ItemConfig ic = JsonMgr.GetSingleton().GetItemConfigByID(_item.itemId); ItemIco_img.sprite = ResourceMgr.Instance.LoadSprite(ic.icon); ItemNum_txt.text = _item.itemNum.ToString(); }
public void Endow(int _mailis, int _id, int itemnum) { idUse = true; MailId = _mailis; ItemConfig ic = JsonMgr.GetSingleton().GetItemConfigByID(_id); itemLevelbg_img.sprite = ResourceMgr.Instance.LoadSprite(ColorMgr.Border[ic.rare - 1]); Item_img.sprite = ResourceMgr.Instance.LoadSprite(ic.icon); Num.text = itemnum.ToString(); }
private int ComputerExpend() { int expend = 0; for (int i = heroData.Level; i < tempLv; ++i) { expend += JsonMgr.GetSingleton().GetExpByID(i).NeedHero; } return(expend); }
/// <summary> /// 显示单抽界面 /// </summary> /// <param name="items"></param> public void ShowOneItem(Item items, int type) { if (items == null) { return; } RecruitingMgr.Instance.type = type; if ((int)RecruitingType.OrdinaryOne == type) { money_img.sprite = ResourceMgr.Instance.LoadSprite((int)CurrencyType.Copper); costprice_txt.text = ((int)LuckyDrawResoults.OUNITITEM).ToString(); unitcostprice_txt.text = ((int)LuckyDrawResoults.OUNITITEM).ToString(); unitmoney_img.sprite = ResourceMgr.Instance.LoadSprite((int)CurrencyType.Copper); moneyhundred_img.sprite = money_img.sprite; hundredcostprice_txt.text = ((int)LuckyDrawResoults.OHUNDRED).ToString(); ic = JsonMgr.GetSingleton().GetSkillByID(11474); buyitemname_txt.text = "<color=#00FF00>" + "小经验丹" + "</color>"; // buyitemname_txt.text = JsonMgr.GetSingleton().GetSkillByID(11474).name; buyitemlevel_img.sprite = ResourceMgr.Instance.LoadSprite(ColorMgr.Border[ic.type - 1]); } else if ((int)RecruitingType.HighOne == type) { goldmoney_img.sprite = ResourceMgr.Instance.LoadSprite((int)CurrencyType.Gold); goldcostprice_txt.text = ((int)LuckyDrawResoults.HUNITITEM).ToString(); ic = JsonMgr.GetSingleton().GetSkillByID(11473); buyitemlevel_img.sprite = ResourceMgr.Instance.LoadSprite(ColorMgr.Border[ic.type - 2]); buyitemname_txt.text = "<color=#00FFFF>" + "大经验丹" + "</color>"; } buyitem_img.sprite = ResourceMgr.Instance.LoadSprite(ic.icon); buyitemnum_txt.text = ""; if (unititem == null) { unititem = ItemInfo().GetComponent <ItemUIView>(); unititem.Init(); unititem.itemname_obj.SetActive(true); } unititem.gameObject.SetActive(true); unititem.isShow = true; unititem.SetInfo(items.itemId, items.itemNum); sendoneitem_obj.SetActive(true); sendtenitem_obj.SetActive(false); hundred_obj.SetActive(false); if (type == (int)RecruitingType.OrdinaryOne) { unitcopperbutton_obj.SetActive(true); copperbutton_obj.SetActive(false); goldbutton_obj.SetActive(false); } else if (type == (int)RecruitingType.HighOne) { unitcopperbutton_obj.SetActive(false); copperbutton_obj.SetActive(false); goldbutton_obj.SetActive(true); } }
public void SetView(int itemID) { ItemConfig ic = JsonMgr.GetSingleton().GetItemConfigByID(itemID); if (ic == null) { return; } icon_img.sprite = ResourceMgr.Instance.LoadSprite(ic.icon); Num_txt.text = Role.Instance.GetItemNum((ItemID)itemID).ToString(); }